feat(tunnel): route --local-proxy through a typed --proxy

The client dials the server's targets through the proxy (http/https CONNECT or SOCKS5, with login), with the same target checks and no direct fallback. tunnel-test takes --proxy too.
This commit is contained in:
imSp4rky
2026-11-09 19:38:01 -07:00
parent b10fd2d3a4
commit 6f9ab94536
10 changed files with 329 additions and 54 deletions
+4 -3
View File
@@ -207,7 +207,7 @@ order the service used, then renumbers the episodes into the order you asked for
| Flag | Description |
|---|---|
| `--proxy` | Proxy URI, a country or location code resolved from configured providers, or `provider:region` (e.g. `nordvpn:ca`, `gluetun:us`, `protonvpn:de:berlin`, `controld:yul`). |
| `--local-proxy` | With `--remote`, send the server's service requests through your machine's own connection. Works with no other proxy option. Check it first with `unshackle tunnel-test`. See [Proxies & VPN](proxies-and-vpn.md#send-the-servers-requests-through-your-machine). |
| `--local-proxy` | With `--remote`, send the server's service requests through your machine's own connection, or through a `--proxy` that your machine connects to. Check it first with `unshackle tunnel-test`. See [Proxies & VPN](proxies-and-vpn.md#send-the-servers-requests-through-your-machine). |
| `--no-proxy` | Force-disable all proxy use. |
| `--no-proxy-download` | Bypass the proxy for **all downloads** (manifest, licence, and auth stay proxied). |
| `--proxy-download` | Use a different proxy for **all downloads**, in the same forms as `--proxy` (manifest, licence, and auth stay on `--proxy`). |
@@ -251,7 +251,7 @@ unshackle logs in to the service before the search. A service that declares a se
|---|---|
| `-p`, `--profile` | Profile for credentials and cookies. |
| `--proxy` | Proxy URI, country or location code, or `provider:region` (e.g. `controld:ca`). |
| `--local-proxy` | With `--remote`, send the server's search requests through your machine's own connection. Works with no other proxy option. |
| `--local-proxy` | With `--remote`, send the server's search requests through your machine's own connection, or through a `--proxy` that your machine connects to. |
| `--no-proxy` | Force-disable all proxy use. |
| `--remote` | Search on a remote unshackle server. The server logs in to the service. unshackle sends it your credentials, cookies and cache for the profile, and saves the cache that the server sends back. A service that searches with no login gets none of them. |
| `--local` | Search with the local service code, also when the config sets `remote: true` for the service. |
@@ -294,12 +294,13 @@ machine exits from, opens a tunnel to the server, and makes the server look up i
through the tunnel. It stops at the first step that fails.
```
unshackle tunnel-test [--server NAME]
unshackle tunnel-test [--server NAME] [--proxy VALUE]
```
| Flag | Description |
|---|---|
| `--server` | Name of the remote server from `remote_services` config, if you configure more than one. |
| `--proxy` | Test the route through this proxy, as `--local-proxy --proxy` uses it. Takes any `--proxy` value. |
See [Proxies & VPN](proxies-and-vpn.md#send-the-servers-requests-through-your-machine).
+22 -9
View File
@@ -27,7 +27,7 @@ Five options on the `dl` command control proxying at download time:
| Option | Effect |
|---|---|
| `--proxy` | The proxy to use. Either an explicit URI, or a query that unshackle resolves against your configured providers. |
| `--local-proxy` | With `--remote`, send the server's service requests through your machine's own connection. Works with no other proxy option. See [Send the server's requests through your machine](#send-the-servers-requests-through-your-machine). |
| `--local-proxy` | With `--remote`, send the server's service requests through your machine's own connection, or through a `--proxy` that your machine connects to. See [Send the server's requests through your machine](#send-the-servers-requests-through-your-machine). |
| `--no-proxy` | Force **all** proxy use off. No providers are initialised and no proxy query is resolved. |
| `--no-proxy-download` | Use the proxy for the manifest, licence, and authentication, but bypass it for the **downloads** themselves. |
| `--proxy-download` | Use `--proxy` for the manifest, licence, and authentication, and a different proxy for the **downloads**. Takes the same forms as `--proxy`. |
@@ -273,18 +273,31 @@ unshackle dl --remote --local-proxy EXAMPLE 81234567
A VPN app that covers your whole machine then also covers the server's requests, so the
service sees your VPN's IP address. `--local-proxy` needs `--remote` (or a service with
`remote: true`), and it works with no other proxy option: unshackle stops if you also give
`--proxy`, `--no-proxy`, `--proxy-download` or `--no-proxy-download`. A proxy option from the `dl`
config defaults does not count: `--local-proxy` turns it off for the run.
`remote: true`). unshackle stops if you also give `--no-proxy`, `--proxy-download` or
`--no-proxy-download`. A proxy option from the `dl` config defaults does not count:
`--local-proxy` turns it off for the run.
A `--proxy` on `localhost` or a loopback address, such as the local port of a VPN app, stops a
`--remote` run with `That proxy is on your machine, so --remote cannot use it`. Connect the VPN
app for the whole machine, then use `--local-proxy` without `--proxy`.
Add `--proxy` to send the server's requests through a proxy that your machine connects to. The
proxy can be on your machine, such as the local port of a VPN app or `hola-proxy`, or any value
that `--proxy` takes, such as `ca` or `nordvpn:us`:
```shell
unshackle dl --remote --local-proxy --proxy http://127.0.0.1:8080 EXAMPLE 81234567
```
The proxy must be `http://`, `https://`, `socks5://` or `socks5h://`, with a username and
password in the URI if it needs them. If the proxy fails, the request fails: unshackle never
sends it from your own connection instead. Your machine still refuses a target on your own
machine or network, and a host name that your machine resolves to a local address only.
Without `--local-proxy`, a `--proxy` on `localhost` or a loopback address stops a `--remote` run
with `--remote cannot use a proxy on this machine without --local-proxy`, because the server
cannot reach it.
#### Test it first
`unshackle tunnel-test` checks the route before a real run. Add `--server <name>` to test a
server other than the default one:
server other than the default one, and `--proxy <value>` to test the route through a proxy:
```shell
unshackle tunnel-test
@@ -292,7 +305,7 @@ unshackle tunnel-test
It does three steps, and it stops at the first one that fails:
1. It looks up the IP address that your machine exits from.
1. It looks up the IP address that your machine exits from, through `--proxy` if you give one.
2. It opens a tunnel to the server.
3. It makes the server look up its exit IP address through the tunnel. That address must be
the same as in step 1, or in the same country when one lookup used IPv4 and the other IPv6.