core-geth
core-geth copied to clipboard
p2p: add --use-proxy flag for SOCKS5 proxy support
Add support for routing P2P connections through a SOCKS5 proxy specified via ALL_PROXY or all_proxy environment variables. This enables nodes to connect to peers through proxy servers when needed.
Key changes:
- Add --use-proxy CLI flag to enable proxy detection
- Implement proxy dialing with context cancellation support
- Add debug logging to track proxy usage
- Prevent goroutine leaks on context cancellation
The implementation uses golang.org/x/net/proxy.FromEnvironment() which detects SOCKS5 proxies from ALL_PROXY/all_proxy environment variables.
This PR will fix #686