Toy sock5 implementation of RFC 1928.
-
IPv4 only, IPv6 ... not implemented fully
-
The only difference between
socks5
andsocks5h
is hostname resolution.curl(1)
manual has the following:
--socks5-hostname: Use the specified SOCKS5 proxy (and let the proxy resolve the host name).
--socks5: Use the specified SOCKS5 proxy - but resolve the host name locally.
- start the socks5 proxy
# python version
python server.py
# Go version
go build && ./toy-socks5
- test with curl
# local resolution
curl -v --socks5 127.0.0.1:1081 https://tools.ietf.org/html/rfc1928
curl -v --proxy 'socks5://127.0.0.1:1081' 'https://tools.ietf.org/html/rfc1928'
# remote resolution
curl -v --socks5-hostname 127.0.0.1:1081 https://tools.ietf.org/html/rfc1928
curl -v --proxy 'socks5h://127.0.0.1:1081' 'https://tools.ietf.org/html/rfc1928'
- run with Vagrant and VirtualBox
Known issue: Vagrant image for Archlinux starts reflector-init.service before sshd
, this takes a long time due to slow arch mirrors and prevents Vagrant from ssh'ing into the box until sshd
starts.
# launch an Archlinux VM with port forwarding configured
# see Vagrantfile for details
./v.sh start
# stop the VM
./v.sh stop
- Full IPv6 support
-
Other authentication methods (GSSAPI and username/password)
-
Other socks5 commands (bind and UDP associate)