mirror of
https://github.com/jmcorgan/fips.git
synced 2026-07-30 19:46:15 +00:00
The Nym transport was a near-clone of the Tor transport's outbound SOCKS5 path. Extract the shared logic into src/transport/socks5/ so both transports drive one implementation instead of two maintained copies: - share one SOCKS5 mock server between the tor and nym tests - extract the common send/receive/connect counters into a shared ProxiedStatsBase (snapshot structs and emitted metrics unchanged) - add a shared Socks5Dialer that collapses all six connect variants; the sole dialing difference (tor's per-destination circuit-isolation auth vs nym's no-auth) is an enum on the dialer - route both tor and nym dialing through the shared dialer - share the proxied connection pool, generic over a per-connection meta type that carries tor's inbound/outbound direction counting (nym uses the unit type) - share the proxied receive loop Behavior-neutral: no wire-format, config-key, emitted-metric, log, or error-variant change. Tor keeps its control-port, inbound/onion, and directory surface and its own address validation.