mirror of
https://github.com/go-gost/x.git
synced 2026-10-19 08:15:33 +00:00
Adds SOCKS5 handler and connector support for Tor-specific RESOLVE (0xF0) and RESOLVE_PTR (0xF1) commands, enabling tools like torsocks and tor-resolve to work through GOST when forwarding to a Tor SOCKS5 proxy. - Define CmdResolve (0xF0) and CmdResolvePTR (0xF1) in x/internal/util/socks - Add ContextWithSocks5Cmd/Socks5CmdFromContext for per-request command override - Connector reads context command, sends it upstream, returns resolveConn - resolveConn wraps net.Conn and exposes resolved addr via Metadata() - Handler dispatches 0xF0/0xF1 to handleResolve/handleResolvePTR - Gate behind enableTor metadata (tor=true), reject with CmdUnsupported by default - 9 unit tests across ctx/, connector/, handler/ packages