Add SOCKS5/Tor proxy support for relay connections - #51
Merged
Conversation
Readers and bridge operators can route all relay traffic through a SOCKS5 proxy via --proxy or GOPHERKIND_PROXY (socks5h, so DNS and .onion names resolve at the proxy). Onion relay URLs are accepted only when proxied. Trusted local development relays are still dialled directly. When proxied, the socket-time DNS guard cannot run, so untrusted relay URLs keep only the hostname-level internal-address check; this is documented. docs/privacy.md states the threat model plainly: gopherkind is a durability and authorship tool, not a privacy tool. It covers what is public by design, what relays and bridges can observe, Tor and onion-service mitigations, and what is out of scope. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
All relay connections (reads, publishes, NIP-46 signing, bridge fetches) can now route through a SOCKS5 proxy:
socks5his enforced (DNS resolves at the proxy), which also makeswss://....onionrelay URLs reachable; they are rejected when no proxy is configured.Why
Relays learn a reader's IP address alongside every subscription filter. This removes the network-location half of that leak. The read-pattern half is inherent to Nostr and is stated plainly, with mitigations (relay choice, onion relays, onion-service deployment), in the new docs/privacy.md threat model page, which also says clearly what this tool is not: not anonymous, not metadata-resistant, not secret.
Verification
--proxy socks5h://127.0.0.1:9050).Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com