Skip to content

feat(torrent): send torrents through a SOCKS5 or HTTP proxy - #680

Merged
linroid merged 2 commits into
mainfrom
feat/torrent-proxy
Nov 14, 2026
Merged

linroid merged 2 commits into
mainfrom
feat/torrent-proxy

Conversation

@linroid

@linroid linroid commented Nov 14, 2026

Copy link
Copy Markdown
Owner

Stacked on #679.

What

  • TorrentConfig.proxy (a ProxyAddress, read as the engine starts) sends every torrent through a proxy. The engine then runs over ProxiedTorrentNetwork: peer connections are tunneled with SOCKS5 CONNECT (user name and password, host names left to the proxy) or HTTP CONNECT (Basic credentials).
  • What a proxy cannot carry is off rather than sent around it: UDP sockets send and receive nothing, the peer listener binds loopback, and DHT, uTP, port mapping and local discovery are off whatever the settings say. HTTP trackers, web seeds, metainfo and tracker lists go through HttpEngine.withProxy; an engine that cannot use a proxy fails them.
  • [torrent] useProxy (off by default) makes the apps and the CLI pass the manual proxy of [download.proxy]. Settings → BitTorrent → Connections → Use the proxy, for this device; strings in all ten languages.

Limits

  • Read when the engine starts: the switch and a changed proxy take effect after a restart.
  • Fewer peers through a proxy: no DHT, no UDP trackers, no incoming connections.
  • Tracker host names may still be resolved by the system's DNS.
  • The proxy's bypass list does not apply to torrents.
  • No control for a remote device's setting; ketch server reads it from its config file.

Snapshots

Light Dark

Tests

ProxiedTorrentNetworkTest (scripted SOCKS5 and HTTP proxies on loopback: tunnels by address and by name, sign-in, refusals, silent UDP, loopback listener), TorrentSettingsTest (the config switch). The torrent, config, CLI and app JVM suites, the iOS compiles and the Android compile pass locally. No test downloads a whole torrent through a proxy.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-14T12:11:30.586063Z a190fa4 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@claude

claude Bot commented Nov 14, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a190fa440f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@linroid
linroid force-pushed the feat/torrent-move-ui branch from 09db716 to fa00f8b Compare November 14, 2026 13:12
@linroid
linroid force-pushed the feat/torrent-move-ui branch from fa00f8b to 8dbb866 Compare November 14, 2026 13:48
@linroid
linroid force-pushed the feat/torrent-move-ui branch from 8dbb866 to 79a019b Compare November 14, 2026 13:51
@linroid
linroid force-pushed the feat/torrent-move-ui branch from 79a019b to 4f860fd Compare November 14, 2026 14:30
Base automatically changed from feat/torrent-move-ui to main November 14, 2026 14:51
@github-actions

Copy link
Copy Markdown
Contributor

Test Results

 2 325 files  + 5   2 353 suites  +5   58m 50s ⏱️ -22s
16 379 tests +20  16 092 ✅ +20  287 💤 ±0  0 ❌ ±0 
19 972 runs  +32  19 685 ✅ +32  287 💤 ±0  0 ❌ ±0 

Results for commit 756e8f0. ± Comparison against base commit 976cd43.

@linroid
linroid merged commit ca3b660 into main Nov 14, 2026
14 checks passed
@linroid
linroid deleted the feat/torrent-proxy branch November 14, 2026 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant