|
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | +# Winload <img src="docs/images/miku.png" height="32px"> |
| 5 | + |
| 6 | +> 輕若飛鴻,疾若奔雷;居終端之一隅,而觀網脈之往來。其意取自 Linux 之 `nload`,而為今世諸機所用。 |
| 7 | +
|
| 8 | +> **[📖 English](readme.md)** |
| 9 | +> **[📖 简体中文(大陆)](readme.zh-cn.md)** |
| 10 | +> **[📖 繁體中文(台灣)](readme.zh-tw.md)** |
| 11 | +> **[📖 日本語](readme.jp.md)** |
| 12 | +> **[📖 한국어](readme.ko.md)** |
| 13 | +> **[📖 文言文](readme.lzh.md)** |
| 14 | +
|
| 15 | +[](https://github.com/VincentZyuApps/winload) |
| 16 | +[](https://gitee.com/vincent-zyu/winload) |
| 17 | + |
| 18 | +[](https://github.com/VincentZyuApps/winload/releases) |
| 19 | +[](https://github.com/VincentZyuApps/winload/releases) |
| 20 | +[](https://github.com/VincentZyuApps/winload/releases) |
| 21 | +[](https://github.com/VincentZyuApps/winload/releases) |
| 22 | + |
| 23 | +[](https://pypi.org/project/winload/) |
| 24 | +[](https://www.npmjs.com/package/@vincentzyuapps/winload) |
| 25 | +[](https://crates.io/crates/winload) |
| 26 | + |
| 27 | +[](https://scoop.sh/#/apps?q=%22https%3A%2F%2Fgithub.qkg1.top%2FVincentZyuApps%2Fscoop-bucket%22&o=false) |
| 28 | +[](https://aur.archlinux.org/packages/winload-rust-bin) |
| 29 | +[](https://github.com/VincentZyuApps/winload/releases) |
| 30 | +[](https://github.com/VincentZyuApps/winload/releases) |
| 31 | +[](https://github.com/VincentZyuApps/homebrew-tap/blob/main/Formula/winload.rb) |
| 32 | + |
| 33 | +> **[📖 構築之書](.github/workflows/build.zh-cn.md)** |
| 34 | +
|
| 35 | +## 🚀 序 |
| 36 | + |
| 37 | +`Winload` 者,終端中觀網流之器也。其初生於 Windows,欲補 `nload` 不能行於其上之闕;今則兼濟 Linux、macOS,亦及諸架構。其屏若素帛,其線若江河;上行下行,一覽而知。包裹之小,起勢之速,置於案頭,若佩玉在身,常用而不覺累。 |
| 38 | + |
| 39 | +## 🙏 謝 |
| 40 | + |
| 41 | +Winload 承 Roland Riegel 所作 「[nload](https://github.com/rolandriegel/nload)」 之意。前賢鑿井,後人飲水;其構想與體驗,皆為此器開山之石。 |
| 42 | + |
| 43 | +https://github.com/rolandriegel/nload |
| 44 | + |
| 45 | +## ✨ 要義 |
| 46 | + |
| 47 | +- **雙本並行** |
| 48 | + - **Rust 本**:迅疾、安穩、內存無虞,且可成一靜態二進制,日常巡網最宜。 |
| 49 | + - **Python 本**:易改易拓,若欲試新意、接旁器、作雛形,取之甚便。 |
| 50 | +- **橫行諸臺**:Windows、Linux、macOS 皆可用,x64 與 ARM64 亦俱備。 |
| 51 | +- **即時成圖**:入流出流,頃刻見其高下;吞吐之數,如觀潮汐。 |
| 52 | +- **界面清簡**:承 `nload` 舊風,不事繁飾,而所需皆在。 |
| 53 | + |
| 54 | +## 📊 功力校驗 |
| 55 | + |
| 56 | +> ⚡ Winload(Rust)可得 **約 10ms 啟動**,二進制 **小於 5MB**。較 Python 本輕捷甚多,與 C++ nload 之效亦可相頡頏。 |
| 57 | +
|
| 58 | + |
| 59 | + |
| 60 | +## 🔧 自源而行 |
| 61 | + |
| 62 | +### Python |
| 63 | + |
| 64 | +```bash |
| 65 | +git clone https://github.com/VincentZyuApps/winload.git |
| 66 | +# 中土網路若遲,亦可取 Gitee: |
| 67 | +# git clone https://gitee.com/vincent-zyu/winload.git |
| 68 | +cd winload/py |
| 69 | +pip install -r requirements.txt |
| 70 | +python main.py |
| 71 | +``` |
| 72 | + |
| 73 | +### Rust |
| 74 | + |
| 75 | +```bash |
| 76 | +git clone https://github.com/VincentZyuApps/winload.git |
| 77 | +cd winload/rust |
| 78 | +cargo run --release |
| 79 | +cargo run --release -- --help # 示助 |
| 80 | +cargo run --release -- --version # 示版 |
| 81 | +``` |
| 82 | + |
| 83 | +## 🐍 Python 本安置 |
| 84 | + |
| 85 | +> 💡 **本末之辨**:PyPI 與 GitHub/Gitee 所得者,乃 Python 本。 |
| 86 | +> Cargo 所供者,乃 Rust 源碼,可於本地鑄成。 |
| 87 | +> Scoop、AUR、npm、APT、RPM 及 GitHub Releases 所分發者,多為 **Rust 二進制**。 |
| 88 | +
|
| 89 | +### Python (pip) |
| 90 | + |
| 91 | +```bash |
| 92 | +pip install winload |
| 93 | +winload |
| 94 | +``` |
| 95 | + |
| 96 | +若欲升之: |
| 97 | + |
| 98 | +```bash |
| 99 | +pip install -U winload |
| 100 | +``` |
| 101 | + |
| 102 | +## 📥 Rust 本安置(薦) |
| 103 | + |
| 104 | +Rust 本尤輕且疾,若但欲監看網流,宜先取之。 |
| 105 | + |
| 106 | +### npm(諸臺可用) |
| 107 | + |
| 108 | +```bash |
| 109 | +npm install -g @vincentzyuapps/winload |
| 110 | +winload |
| 111 | +``` |
| 112 | + |
| 113 | +或以 npx 一試: |
| 114 | + |
| 115 | +```bash |
| 116 | +npx @vincentzyuapps/winload |
| 117 | +``` |
| 118 | + |
| 119 | +### Cargo(自源編鑄) |
| 120 | + |
| 121 | +```bash |
| 122 | +cargo install winload |
| 123 | +winload |
| 124 | +``` |
| 125 | + |
| 126 | +### Windows (Scoop) |
| 127 | + |
| 128 | +若已備 Scoop,可引 VincentZyuApps 之桶而取: |
| 129 | + |
| 130 | +```powershell |
| 131 | +scoop bucket add VincentZyuApps https://github.com/VincentZyuApps/scoop-bucket |
| 132 | +scoop install winload |
| 133 | +winload |
| 134 | +``` |
| 135 | + |
| 136 | +更新之: |
| 137 | + |
| 138 | +```powershell |
| 139 | +scoop update winload |
| 140 | +``` |
| 141 | + |
| 142 | +### Arch Linux (AUR) |
| 143 | + |
| 144 | +```bash |
| 145 | +yay -S winload-rust-bin |
| 146 | +``` |
| 147 | + |
| 148 | +或: |
| 149 | + |
| 150 | +```bash |
| 151 | +paru -S winload-rust-bin |
| 152 | +``` |
| 153 | + |
| 154 | +### Linux(一令而裝) |
| 155 | + |
| 156 | +若欲直取 Releases 中之成品,可行: |
| 157 | + |
| 158 | +```bash |
| 159 | +curl -fsSL https://raw.githubusercontent.com/VincentZyuApps/winload/main/docs/install_scripts/install.sh | bash |
| 160 | +``` |
| 161 | + |
| 162 | +> 📄 [觀 GitHub 安裝腳本之源](https://github.com/VincentZyuApps/winload/blob/main/docs/install_scripts/install.sh) |
| 163 | +
|
| 164 | +若 GitHub 遲滯,亦可取 Gitee: |
| 165 | + |
| 166 | +```bash |
| 167 | +curl -fsSL https://gitee.com/vincent-zyu/winload/raw/main/docs/install_scripts/install_gitee.sh | bash |
| 168 | +``` |
| 169 | + |
| 170 | +> 📄 [觀 Gitee 安裝腳本之源](https://gitee.com/vincent-zyu/winload/blob/main/docs/install_scripts/install_gitee.sh) |
| 171 | +
|
| 172 | +### macOS / Linux(Homebrew) |
| 173 | + |
| 174 | +```bash |
| 175 | +brew tap VincentZyuApps/tap |
| 176 | +brew install winload |
| 177 | +``` |
| 178 | + |
| 179 | +更新之: |
| 180 | + |
| 181 | +```bash |
| 182 | +brew update |
| 183 | +brew upgrade winload |
| 184 | +``` |
| 185 | + |
| 186 | +### GitHub Releases |
| 187 | + |
| 188 | +可往 Releases 擇其所需: |
| 189 | + |
| 190 | +```text |
| 191 | +https://github.com/VincentZyuApps/winload/releases |
| 192 | +``` |
| 193 | + |
| 194 | +常見器類: |
| 195 | + |
| 196 | +- Windows x64 / ARM64 |
| 197 | +- Linux x64 / ARM64 |
| 198 | +- macOS x64 / ARM64 |
| 199 | +- Android x64 / ARM64 |
| 200 | + |
| 201 | +下載既畢,賦予可行之權,置於 PATH 中,即可呼之。 |
| 202 | + |
| 203 | +## ⌨️ 用法 |
| 204 | + |
| 205 | +常用之法甚簡: |
| 206 | + |
| 207 | +```bash |
| 208 | +winload |
| 209 | +``` |
| 210 | + |
| 211 | +示助: |
| 212 | + |
| 213 | +```bash |
| 214 | +winload --help |
| 215 | +``` |
| 216 | + |
| 217 | +示版: |
| 218 | + |
| 219 | +```bash |
| 220 | +winload --version |
| 221 | +``` |
| 222 | + |
| 223 | +### 參數 |
| 224 | + |
| 225 | +可用之參數,依版本而或有增益。大抵如下: |
| 226 | + |
| 227 | +```bash |
| 228 | +winload [OPTIONS] |
| 229 | +``` |
| 230 | + |
| 231 | +常見用途: |
| 232 | + |
| 233 | +- 選定網卡 |
| 234 | +- 調整刷新間隔 |
| 235 | +- 顯示版本 |
| 236 | +- 顯示幫助 |
| 237 | + |
| 238 | +若不知所措,行: |
| 239 | + |
| 240 | +```bash |
| 241 | +winload --help |
| 242 | +``` |
| 243 | + |
| 244 | +則可見諸旗幟。 |
| 245 | + |
| 246 | +### 鍵法 |
| 247 | + |
| 248 | +於 TUI 中,可用常見按鍵操其界面。若版本支援,通常可: |
| 249 | + |
| 250 | +- `q`:退 |
| 251 | +- `Ctrl+C`:止 |
| 252 | +- 方向鍵:移視圖或選項 |
| 253 | + |
| 254 | +具體仍以 `--help` 與當前版本之提示為準。 |
| 255 | + |
| 256 | +## 🪟 Windows 回環流量(127.0.0.1) |
| 257 | + |
| 258 | +Windows 對回環流量之統計,與 Linux 等系統不同。若觀 `127.0.0.1` 或本機服務互通之流量,或有不顯、不全、難準之處。 |
| 259 | + |
| 260 | +相關詳說見: |
| 261 | + |
| 262 | +- [Windows loopback docs](docs/win_loopback.md) |
| 263 | +- [Windows 回環流量說明(簡體中文)](docs/win_loopback.zh-cn.md) |
| 264 | +- [Windows 回環流量說明(繁體中文)](docs/win_loopback.zh-tw.md) |
| 265 | + |
| 266 | +## 🖼️ 一覽 |
| 267 | + |
| 268 | +#### Python 本 |
| 269 | + |
| 270 | + |
| 271 | + |
| 272 | +#### Rust 本 |
| 273 | + |
| 274 | + |
| 275 | + |
| 276 | + |
| 277 | + |
| 278 | +## 📦 所賴 |
| 279 | + |
| 280 | +### Python 本 |
| 281 | + |
| 282 | +Python 本常賴下列物: |
| 283 | + |
| 284 | +- `psutil` |
| 285 | +- `rich` |
| 286 | +- 其他列於 `py/requirements.txt` 者 |
| 287 | + |
| 288 | +### Rust 本 |
| 289 | + |
| 290 | +Rust 本以 Cargo 管其依賴,詳見: |
| 291 | + |
| 292 | +```text |
| 293 | +rust/Cargo.toml |
| 294 | +``` |
| 295 | + |
| 296 | +## 🧭 結語 |
| 297 | + |
| 298 | +夫網流無形,而 Winload 使之有象;包行於終端,聲息不驚,卻能令千端萬緒之吞吐,盡呈目前。若欲知一機之網脈,是器可為案上小燈,亦可為夜航之星。 |
0 commit comments