A Tor client implementation in pure Go.
- Tor v3 client protocol (link handshake, circuit building, stream multiplexing)
- 3-hop onion-routed circuits with ntor key exchange
- v3 onion service client (.onion address resolution and connection)
- SOCKS5 proxy server for transparent traffic routing
- Directory authority consensus fetching with cryptographic signature validation
- Bandwidth-weighted relay selection (guard, middle, exit)
- Minimal dependencies — only
golang.org/x/cryptoandfilippo.io/edwards25519
go run github.com/cvsouth/tor-go/cmd/tor-client@latestIn another terminal:
curl --socks5-hostname 127.0.0.1:9050 https://check.torproject.org/api/ip
# {"IsTor":true,"IP":"..."}go get github.com/cvsouth/tor-goSee the API reference on pkg.go.dev and cmd/tor-client for a complete working example.
To report a security vulnerability, see SECURITY.md.