feat(client): allow passing outgoing traffic through a SOCKS5 proxy#86
Merged
Itsusinn merged 2 commits intoItsusinn:mainfrom Feb 2, 2026
Merged
feat(client): allow passing outgoing traffic through a SOCKS5 proxy#86Itsusinn merged 2 commits intoItsusinn:mainfrom
Itsusinn merged 2 commits intoItsusinn:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds support for routing outgoing TUIC client traffic through a SOCKS5 proxy, addressing scenarios where external tools like proxychains-ng cannot handle UDP traffic sockification.
Changes:
- Added SOCKS5 proxy configuration to the relay config with optional username/password authentication
- Implemented custom SOCKS5 UDP socket adapter for Quinn endpoint to handle UDP-over-SOCKS5
- Added SOCKS5 handshake logic with authentication and UDP ASSOCIATE support
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tuic-client/src/config.rs | Added ProxyConfig struct and proxy field to Relay config with test coverage |
| tuic-client/src/error.rs | Added Socks5 error variant for SOCKS5-related errors |
| tuic-client/src/connection/socks5.rs | Implemented Socks5UdpSocket adapter implementing Quinn's AsyncUdpSocket trait |
| tuic-client/src/connection/mod.rs | Integrated SOCKS5 proxy support into endpoint creation with handshake and conditional rebinding |
| tuic-tests/tests/integration_tests.rs | Updated integration tests to include proxy: None field |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This could be useful if you want to reach the target tuic-server through another proxy. And usually external tools such as [proxychains-ng does not support sockifying UDP traffic](rofl0r/proxychains-ng#570). The SOCKS5 proxy should support UDP. So there is a small pitfall when you use a SOCKS5 proxy that is another tuic-server with an SOCKS5 outbound enabled and its `allow_udp` is set as false, because UDP over SOCKS5 outbound of tuic-server is not implemented.
…ipv6 socks5 server; add address unmapping in UdpSession::send and recv
60d2e62 to
8401c9f
Compare
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.
This could be useful if you want to reach the target tuic-server through another proxy. And usually external tools such as proxychains-ng does not support sockifying UDP traffic.
The SOCKS5 proxy should support UDP. So there is a small pitfall when you use a SOCKS5 proxy that is another tuic-server with an SOCKS5 outbound enabled and its
allow_udpis set as false, because UDP over SOCKS5 outbound of tuic-server is not implemented.