Skip to content

Commit cd215fd

Browse files
committed
feat: add SOCKS5 proxy and resumable web uploads
1 parent 572749a commit cd215fd

27 files changed

Lines changed: 1903 additions & 86 deletions

CHANGELOG.en.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ All notable changes to `ii` are documented here. The default Chinese version is
1111
- Added process-local FIFO `ii queue` and polling `ii watch`, including delay, repeat, stability detection, and existing sending backends.
1212
- `ii send`, `ii recv`, `ii watch`, and `ii queue` support `--quic-port` to fix the P2P Iroh UDP port; `ii doctor --nat` reports a short-lived UDP, NAT, and relay probe.
1313
- `ii web --once` exits after the first complete ordinary-file download; directory pages, HEAD, Range, uploads, and failed requests do not stop it.
14+
- `ii recv --trace` now reports Iroh's selected LAN, direct, or relay path and RTT.
15+
- `ii send`, `ii watch`, and `ii queue` accept repeated `--relay`; multiple explicit relays are probed for reachability and latency, while default n0 relay behavior is unchanged.
16+
- `ii send --web` and `ii web --upload` support resumable browser uploads; reselecting the same file after a disconnect or refresh continues it.
17+
- Added `ii socks5`, an ordinary SOCKS5 proxy with `CONNECT`, `UDP ASSOCIATE`, `BIND`, IPv4, IPv6, domain targets, and optional username/password authentication.
1418

1519
## 0.3.4 - 2026-08-06
1620

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
- 新增进程内 FIFO `ii queue` 与轮询式 `ii watch`,支持延迟、定时、稳定检测和现有发送后端。
1212
- `ii send``ii recv``ii watch``ii queue` 支持 `--quic-port` 固定 P2P Iroh UDP 端口;`ii doctor --nat` 输出短生命周期的 UDP、NAT 和 relay 探测结果。
1313
- `ii web --once` 在第一次完整普通文件下载后关闭;目录页、HEAD、Range、上传和失败请求不会触发关闭。
14+
- `ii recv --trace` 输出 Iroh 实际选中的 LAN、直连或 relay 路径及 RTT。
15+
- `ii send``ii watch``ii queue``--relay` 可重复指定;多个显式 relay 会按探测到的可达性和延迟择优,默认 n0 relay 行为不变。
16+
- `ii send --web``ii web --upload` 支持浏览器分块上传续传,断网或刷新后重新选择同一文件即可继续。
17+
- 新增 `ii socks5` 普通 SOCKS5 代理,支持 `CONNECT``UDP ASSOCIATE``BIND`、IPv4、IPv6、域名目标和可选用户名密码认证。
1418

1519
## 0.3.4 - 2026-08-06
1620

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ unused-async = "warn"
1818

1919
[package]
2020
name = "ii"
21-
version = "0.3.5"
21+
version = "0.3.6"
2222
edition.workspace = true
2323
rust-version.workspace = true
2424
license.workspace = true

README.en.md

Lines changed: 59 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,53 @@
2626
- Use generic S3, Cloudflare R2, Azure Blob, WebDAV, FTP, or SFTP as optional backends, with cleanup after receiving.
2727
- It also provides LAN web sharing, WebDAV, browser transfer, TCP tunnels, and self-hosted relays.
2828

29+
## Common Use Cases
30+
31+
### `ii web`
32+
33+
- Run a temporary LAN file site from the current directory for browsing, downloads, and uploads.
34+
- Import a phone photo library by starting `ii web` on a computer and uploading photos or videos after scanning its QR code.
35+
- Distribute meeting materials through a QR code for direct download.
36+
- Serve local static assets such as installers, videos, or web files to TVs, tablets, and development devices.
37+
- Collect files from several people into a chosen directory.
38+
- Provide a file portal on an offline LAN without cloud storage, accounts, or Internet access.
39+
40+
### `ii dav`
41+
42+
- Mount any directory as a network drive in Windows Explorer, macOS Finder, or a Linux file manager.
43+
- Access a computer directory from a phone file manager to copy, move, delete, or create files and folders.
44+
- Turn an old computer or small host into a lightweight NAS for one directory.
45+
- Open and save remote text or configuration files from WebDAV-capable editors.
46+
- Use one working directory as a shared asset drive for tablets, phones, and computers.
47+
- Provide a temporary delivery directory that clients or colleagues can access as a network drive without installing `ii`.
48+
49+
### `ii socks5`
50+
51+
- Provide a standard SOCKS5 proxy endpoint for browsers, downloaders, and command-line tools.
52+
- Route software without built-in proxy settings through another machine's network connection with a SOCKS5-capable proxyifier.
53+
- Let LAN devices use a computer with Internet access, a VPN, or special routes as their proxy exit.
54+
- Test proxy compatibility for `CONNECT`, UDP, DNS resolution, and IPv6.
55+
- Provide a configurable proxy address to games, media players, or IoT devices that support one.
56+
- Compare DNS and connection paths across enterprise, VPN, and home networks.
57+
58+
### `ii relay`
59+
60+
- Self-host an Iroh relay as the explicit cross-network forwarding path for `ii send --relay`.
61+
- Deploy relays on an intranet, overseas, or in a specific region instead of relying entirely on public relays.
62+
- Validate Iroh connection and forwarding behavior on restricted networks.
63+
64+
### `ii tunnel`
65+
66+
- Expose a local TCP service such as a development site, SSH server, database, or game server.
67+
- Make a machine without a public IP reachable remotely.
68+
- Provide temporary remote assistance without configuring router port forwarding.
69+
70+
### `ii discover`
71+
72+
- Scan for running `ii` services on the LAN.
73+
- Find same-subnet send jobs, directory sites, and WebDAV services without typing IP addresses.
74+
- Discover shared endpoints quickly in meeting rooms, labs, and server rooms.
75+
2976
## Install
3077

3178
Linux x86_64 and Apple Silicon macOS:
@@ -162,7 +209,7 @@ ii recv ii1k7v...x9a --stdout > project.tar.gz
162209
ii recv ii1k7v...x9a --json
163210
```
164211

165-
If the network drops halfway, run the same `ii recv` command again and it continues receiving. If the target file already exists with the same content, it is skipped. If the name matches but the content differs, it is overwritten. `ii send` and `ii recv` show progress, speed, and elapsed time; `--trace` prints connection diagnostics. `--stdout` cannot be combined with `--json`.
212+
If the network drops halfway, run the same `ii recv` command again and it continues receiving. If the target file already exists with the same content, it is skipped. If the name matches but the content differs, it is overwritten. `ii send` and `ii recv` show progress, speed, and elapsed time; `ii recv --trace` prints connection stages, the final direct or relay path, and RTT. `--stdout` cannot be combined with `--json`.
166213

167214
`--checksum md5|sha256` computes the received file or directory tar stream after completion and cannot be combined with `--stdout`. `--quic-port` applies only to P2P tickets.
168215

@@ -183,7 +230,7 @@ ii dav .\shared --read-only
183230
ii dav .\shared --port 8443 --username alice --password secret --tls --domain dav.example.com --cert D:\certs\fullchain.pem --key D:\certs\privkey.pem
184231
```
185232

186-
`ii send --web` serves a download page for one file or folder. It exits after the first complete `/download` response by default; add `-t` to keep serving until `Ctrl+C`, and the first concurrent download to finish ends the process. Visiting the page, uploads, and failed downloads do not exit. `ii web` displays an nginx-style directory listing and serves the current directory when no directory is given. `--upload` enables multi-file uploads only; their default destination is `./ii/` under the startup directory, while `--path <dir>` selects another directory. `ii dav` reads and writes its served directory directly, not the web upload directory.
233+
`ii send --web` serves a download page for one file or folder. It exits after the first complete `/download` response by default; add `-t` to keep serving until `Ctrl+C`, and the first concurrent download to finish ends the process. Visiting the page, uploads, and failed downloads do not exit. `ii web` displays an nginx-style directory listing and serves the current directory when no directory is given. `--upload` enables multi-file uploads only; their default destination is `./ii/` under the startup directory, while `--path <dir>` selects another directory. Uploads are written in 1 MiB chunks; after a disconnect or refresh, selecting the same file resumes it. `ii dav` reads and writes its served directory directly, not the web upload directory.
187234

188235
`ii dav --username <username> --password <password>` enables HTTP Basic Auth; both options are required together. `--password` is visible in shell history and process listings, so use it only where that is acceptable. `--tls` enables HTTPS. Without `--cert` and `--key`, ii generates a self-signed certificate valid only for the running process, which clients must explicitly trust. For public access, use a trusted PEM certificate or terminate HTTPS in a reverse proxy and bind `ii dav` to `127.0.0.1`. Without `--tls`, Basic Auth credentials travel in clear text.
189236

@@ -223,6 +270,15 @@ ii tunnel -c ii1k7v...x9a
223270

224271
B listens on `127.0.0.1:8080` by default and increments the port when it is occupied. Use `--listen 0.0.0.0:8022` only to expose B's listener to its LAN. Traffic is end-to-end encrypted by Iroh; a ticket holder can use the target until A stops the service. See [ii.md](ii.md) for the full protocol and relay options.
225272

273+
### SOCKS5 Proxy
274+
275+
```powershell
276+
ii socks5
277+
ii socks5 --port 1080 --username alice --password secret
278+
```
279+
280+
`ii socks5` is a standalone ordinary network proxy. It listens on a random `0.0.0.0` port by default and prints the actual address. It supports SOCKS5 `CONNECT`, `UDP ASSOCIATE`, `BIND`, IPv4, IPv6, and domain targets. It does not use Iroh, tickets, or relays. Supplying `--username` and `--password` enables SOCKS5 username/password authentication; both options are required together.
281+
226282
### Self-hosted Relay
227283

228284
You only need this for a fixed relay endpoint.
@@ -241,7 +297,7 @@ ii relay --tls --domain relay.example.com --port 8443 --cert D:\certs\fullchain.
241297
ii send .\video.mp4 --relay https://relay.example.com:8443
242298
```
243299

244-
Without `--port`, the relay chooses a free port. The terminal prints usable IPv4 URLs; `0.0.0.0` is bind-only, and a cloud public IP may need to come from the provider console. `-k` is only for self-signed HTTPS. An explicit HTTP or HTTPS relay forces traffic through that relay. See [ii.md](ii.md) for TLS, NAT, and security boundaries.
300+
Without `--port`, the relay chooses a free port. The terminal prints usable IPv4 URLs; `0.0.0.0` is bind-only, and a cloud public IP may need to come from the provider console. `-k` is only for self-signed HTTPS. An explicit HTTP or HTTPS relay forces traffic through that relay. Repeating `--relay` makes `ii send` probe the explicit relays and select the fastest reachable one; the default n0 relay behavior is unchanged. See [ii.md](ii.md) for TLS, NAT, and security boundaries.
245301

246302
## Desktop GUI
247303

README.md

Lines changed: 59 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,53 @@
2626
- 可选通用 S3、Cloudflare R2、Azure Blob、WebDAV、FTP、SFTP 中转;传完可删除中转对象。
2727
- 另有局域网网页、WebDAV、浏览器直传、TCP 隧道和自建 relay。
2828

29+
## 典型使用场景
30+
31+
### `ii web`
32+
33+
- 临时局域网文件站:当前目录一键公开浏览、下载和上传。
34+
- 手机相册导入:电脑开 `ii web`,手机扫码上传照片或视频。
35+
- 会议资料分发:用二维码让参会者直接下载。
36+
- 本地静态资源站:给电视、平板和开发设备访问安装包、视频或网页文件。
37+
- 临时文件收集箱:多人向指定目录上传材料。
38+
- 离线局域网环境的文件门户:不依赖云盘、账号或外网。
39+
40+
### `ii dav`
41+
42+
- 把任意目录挂载为网络磁盘,可由 Windows Explorer、macOS Finder 或 Linux 文件管理器直接访问。
43+
- 用手机文件管理器访问电脑目录,复制、移动、删除文件或创建目录。
44+
- 把旧电脑或小主机作为轻量 NAS,共享一个目录。
45+
- 让支持 WebDAV 的编辑器直接打开并保存远端文本或配置。
46+
- 作为跨设备素材盘,让平板、手机和电脑同时访问同一个工作目录。
47+
- 建立临时交付目录,客户或同事以网络盘方式取文件,不需要安装 `ii`
48+
49+
### `ii socks5`
50+
51+
- 给浏览器、下载器和命令行工具提供普通 SOCKS5 出口。
52+
- 让缺少内置代理选项的软件配合支持 SOCKS5 的转发器,经另一台机器访问网络。
53+
- 让局域网设备借用一台具备网络、VPN 或特殊路由的电脑出口。
54+
- 调试代理兼容性,验证 `CONNECT`、UDP、域名解析和 IPv6 行为。
55+
- 给支持代理配置的游戏、媒体播放器或 IoT 设备提供代理地址。
56+
- 临时比较企业网络、VPN 和家庭网络下的 DNS 与连接路径。
57+
58+
### `ii relay`
59+
60+
- 自建 Iroh relay,作为 `ii send --relay` 的指定跨网转发路径。
61+
- 在内网、海外或特定地区部署 relay,避免完全依赖公共 relay。
62+
- 在网络受限环境中验证 Iroh 的连接和转发能力。
63+
64+
### `ii tunnel`
65+
66+
- 暴露本机 TCP 服务,例如本地开发站、SSH、数据库或游戏服务器。
67+
- 让没有公网 IP 的机器被远端访问。
68+
- 用于临时远程协助,无需配置路由器端口转发。
69+
70+
### `ii discover`
71+
72+
- 扫描局域网内正在运行的 `ii` 服务。
73+
- 找到同网段的发送任务、目录站和 WebDAV 服务,不必手输 IP。
74+
- 在会议室、实验室或机房快速发现共享端点。
75+
2976
## 安装
3077

3178
Linux x86_64 和 Apple Silicon macOS:
@@ -162,7 +209,7 @@ ii recv ii1k7v...x9a --stdout > project.tar.gz
162209
ii recv ii1k7v...x9a --json
163210
```
164211

165-
断网或传到一半失败后,重新执行同一条 `ii recv` 就会继续接收;如果目标文件已经完整且内容相同,会直接跳过;如果同名但内容不同,会覆盖。`ii send``ii recv` 都会显示传输进度、速率和完成耗时;`--trace` 输出连接诊断`--stdout` 不能与 `--json` 同用。
212+
断网或传到一半失败后,重新执行同一条 `ii recv` 就会继续接收;如果目标文件已经完整且内容相同,会直接跳过;如果同名但内容不同,会覆盖。`ii send``ii recv` 都会显示传输进度、速率和完成耗时;`ii recv --trace` 输出建连阶段、最终直连或 relay 路径和 RTT`--stdout` 不能与 `--json` 同用。
166213

167214
`--checksum md5|sha256` 在接收完成后计算实际文件或目录 tar 流;不能与 `--stdout` 同用。`--quic-port` 只适用于 P2P ticket。
168215

@@ -183,7 +230,7 @@ ii dav .\shared --read-only
183230
ii dav .\shared --port 8443 --username alice --password secret --tls --domain dav.example.com --cert D:\certs\fullchain.pem --key D:\certs\privkey.pem
184231
```
185232

186-
`ii send --web` 为单个文件或目录提供下载页。默认第一个完整 `/download` 响应写完后立即退出;加 `-t` 才持续服务到 `Ctrl+C`,并发下载时第一个完成会直接结束进程。访问下载页、上传和失败下载不会退出。`ii web` 显示 nginx 风格目录列表,省略目录时服务当前目录;`--upload` 才开放多文件上传,默认写入启动目录的 `./ii/``--path <dir>` 可改为指定目录。`ii dav` 直接读写所服务目录,不使用网页上传目录。
233+
`ii send --web` 为单个文件或目录提供下载页。默认第一个完整 `/download` 响应写完后立即退出;加 `-t` 才持续服务到 `Ctrl+C`,并发下载时第一个完成会直接结束进程。访问下载页、上传和失败下载不会退出。`ii web` 显示 nginx 风格目录列表,省略目录时服务当前目录;`--upload` 才开放多文件上传,默认写入启动目录的 `./ii/``--path <dir>` 可改为指定目录。网页上传按 1 MiB 分块写入,断网或刷新后重新选择同一文件会自动继续。`ii dav` 直接读写所服务目录,不使用网页上传目录。
187234

188235
`ii dav --username <username> --password <password>` 启用 HTTP Basic Auth,两个参数必须同时提供。`--password` 会出现在 shell 历史和进程列表中,只适合你明确接受这一风险的场景。`--tls` 开启 HTTPS;未提供 `--cert``--key` 时生成仅当前进程有效的自签证书,客户端必须手动信任。公网请使用受信任 PEM 证书,或让 HTTPS 反向代理终止 TLS 并将 `ii dav` 绑定到 `127.0.0.1`。未启用 `--tls` 时,Basic Auth 凭据会以明文传输。
189236

@@ -223,6 +270,15 @@ ii tunnel -c ii1k7v...x9a
223270

224271
B 默认监听 `127.0.0.1:8080`,端口被占用时自动递增;`--listen 0.0.0.0:8022` 才会暴露给 B 的局域网。流量经 Iroh 端到端加密,ticket 持有者可访问目标直到 A 停止服务。完整用法见 [ii.md](ii.md)
225272

273+
### SOCKS5 代理
274+
275+
```powershell
276+
ii socks5
277+
ii socks5 --port 1080 --username alice --password secret
278+
```
279+
280+
`ii socks5` 是独立的普通网络代理,默认监听 `0.0.0.0` 的随机端口并打印实际地址。支持 SOCKS5 `CONNECT``UDP ASSOCIATE``BIND`、IPv4、IPv6 和域名目标;不经过 Iroh、ticket 或 relay。提供 `--username``--password` 时启用 SOCKS5 用户名密码认证,两个参数必须成对出现。
281+
226282
### 自建 Relay
227283

228284
普通传文件不需要自建 relay。需要固定中继入口时:
@@ -241,7 +297,7 @@ ii relay --tls --domain relay.example.com --port 8443 --cert D:\certs\fullchain.
241297
ii send .\video.mp4 --relay https://relay.example.com:8443
242298
```
243299

244-
省略 `--port` 时随机监听。终端打印实际可用的 IPv4 URL;`0.0.0.0` 只用于监听,云服务器公网 IP 可能需要从控制台取得。`-k` 仅用于自签 HTTPS;指定 HTTP 或 HTTPS relay 后,传输强制经过该 relay。完整 TLS、NAT 与安全边界见 [ii.md](ii.md)
300+
省略 `--port` 时随机监听。终端打印实际可用的 IPv4 URL;`0.0.0.0` 只用于监听,云服务器公网 IP 可能需要从控制台取得。`-k` 仅用于自签 HTTPS;指定 HTTP 或 HTTPS relay 后,传输强制经过该 relay。重复指定 `--relay` 时,`ii send` 探测各显式 relay 的可达性和延迟,选取最快可达节点;不影响默认 n0 relay。完整 TLS、NAT 与安全边界见 [ii.md](ii.md)
245301

246302
## 图形界面
247303

SIZE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ All measurements use `cargo build -p ii --release --locked` followed by UPX
3535
| Seven extension plan: multi-send, filters, rate, JSON, discover, bind, DAV | 6,315,008 | 2,265,600 | +60,928 | `cargo test -p ii --offline --no-fail-fast -- --test-threads=1` (121 tests), workspace check, `cargo build -p ii --release --locked`, `cargo bloat --crates`, UPX `5.1.0 --best --lzma`, `upx -t` |
3636
| Generic S3/R2 split and Azure Blob backend | 6,413,312 | 2,436,608 | +171,008 | `cargo test -p ii --locked` (131 tests), `cargo check -p ii-gui --locked`, `cargo bloat --crates`, UPX `5.1.0 --best --lzma`, `upx -t` |
3737
| Nine low-volume extensions: checksums, metadata, queue/watch, NAT probe, symlink policy, QUIC port, and `web --once` | 6,650,368 | 2,353,152 | -83,456 | `cargo test -p ii --locked` (146 tests), fmt check, diff check, `cargo bloat -p ii --release --crates -n 15`, standard `cargo build -p ii --release --locked`, UPX `5.1.0 --best --lzma`, `upx -t` |
38+
| Path diagnostics, relay selection, resumable web upload, and SOCKS5 | 6,727,168 | 2,377,728 | +24,576 | `cargo test -p ii --locked` (157 tests), fmt check, diff check, `cargo bloat -p ii --release --crates -n 15`, standard `cargo build -p ii --release --locked`, UPX `5.1.0 --best --lzma`, `upx -t` |
3839

39-
Equivalent release rebuilds have varied by up to `1,536` UPX bytes; the latest
40+
Equivalent release rebuilds have varied by up to `3,072` UPX bytes; the latest
4041
measurement is recorded with the pinned `5.1.0` packer.
4142

4243
## QR Dependency Audit

0 commit comments

Comments
 (0)