Repository navigation
Conversation
- Route SOCKS5 UDP ASSOCIATE datagrams through TunnelDomains-aware dialer - Upgrade go-socks5 to v0.1.4 for UDP datagram parsing fixes - Add [UDPServerTunnel] for WireGuard-side UDP port forwarding - Share UDP relay response forwarding between client and server tunnels - Add config, relay, netstack, and SOCKS5 UDP tests
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.
Summary
This completes UDP support in wireproxy:
WithDialAndRequest, which is used by TCPCONNECTbut not by UDPASSOCIATE; UDP datagrams therefore fell back to a direct dial and bypassed WireGuard. UDP now uses a context-aware routed dialer, so each datagram is routed through the tunnel or directly based on its destination host.TunnelDomains/LogDomainsapply to UDP destinations. Destination FQDNs are preserved from the SOCKS5 UDP header, resolved on the selected network (tunnel DNS for tunnelled hosts, system DNS for direct hosts), and logged the same way as TCP connections.go-socks5to v0.1.4 for the SOCKS5 UDP datagram parsing fixes.[UDPServerTunnel]as the server-side counterpart to the existing UDP client tunnel. It listens on the WireGuard side and forwards each remote peer to a local target, mirroring[TCPServerTunnel].[UDPProxyTunnel]and[UDPServerTunnel], including closing sessions on inactivity.New configuration
Tests
Added coverage for:
ASSOCIATEwith a directly dialled destinationASSOCIATEwith a tunnelled destination through netstack[UDPServerTunnel]config parsing and validationRoutedDialContextdirect fallbackValidated with:
Note
The implementation uses the built-in
go-socks5UDP relay: one connected UDP socket per client/destination pair, with endpoint-dependent mapping. This covers DNS, QUIC, voice, and typical game traffic, but is not a full-cone NAT implementation.