-
Notifications
You must be signed in to change notification settings - Fork 162
Open
Description
Currently proxy-chain only handles TCP connections. It would be useful to support SOCKS5 UDP ASSOCIATE (command 0x03 per RFC 1928), which allows clients to send UDP datagrams through the proxy.
Use cases include DNS queries, gaming, VoIP, and QUIC/HTTP3 traffic.
Looking at the code, the server is purely TCP-based. In src/server.ts:115 we create an http.Server, and all connection tracking in registerConnection() at line 303 assumes TCP sockets. There's no dgram usage anywhere.
To add this, we'd need to:
- Add a dgram.Socket in
src/server.tsalongside the HTTP server - Create a new module (maybe
src/socks5_udp.ts) to handle the UDP ASSOCIATE handshake and relay header format - Create UDP relay logic to forward datagrams between clients and targets
- Extend
src/socket.tstypes for UDP associations - Add UDP-specific error handling in
src/statuses.ts - Extend byte counting in
src/utils/count_target_bytes.tsfor UDP stats
Open questions:
- Should this be opt-in via config flag or enabled by default?
- What timeout should we use for idle UDP associations?
- How to surface UDP events to users (new event types on the server?)
Metadata
Metadata
Assignees
Labels
No labels