Tun2socks
Redirect tun flow to socks 5 in golang, support tcp and udp.
Install / Use
/learn @FlowerWrong/Tun2socksREADME
README
How to use it? more
# install golang 1.10+, because of sync.Map
go get -u -v github.com/FlowerWrong/tun2socks
cd tun2socks
go get ./...
cp config.example.ini config.ini
# edit it for free
sudo go run cmd/main.go -h
sudo go run cmd/main.go -v
sudo go run cmd/main.go -c=config.ini
Note
- For darwin and linux, you should use netstack smart branch.
- For windows user, you should use netstack master branch.
Support operating system.
- [x] macOS
- [x] linux
- [x] Windows Vista and above support with tap-windows6, download link, please use netstack master branch.
- [x] Raspberry Pi support
- [x] android support with root
Hot reload config with USR2 signal. Not support windows.
Support route, udp.proxy, proxy, pattern and rule, see config.example.ini.
sudo kill -s USR2 $PID
NOTE: go run not support kill command signal.
As a static library
See c api wiki.
Windows build need to install git + tdm-gcc.
TODO
- [ ] gui
- [ ] ipv6 support
Thanks
- thanks xjdrew/kone for dns fake mode
- thanks yinghuocho/gotun2socks for udp <-> socks5 tunnel
- thanks songgao/water for tun io on many platform
- thanks google/netstack for tcp/ip stack
- thanks google/gopacket for pack/unpack ip package
- thanks miekg/dns for dns parser and server
Related Skills
openhue
339.5kControl Philips Hue lights and scenes via the OpenHue CLI.
sag
339.5kElevenLabs text-to-speech with mac-style say UX.
weather
339.5kGet current weather and forecasts via wttr.in or Open-Meteo
tweakcc
1.5kCustomize Claude Code's system prompts, create custom toolsets, input pattern highlighters, themes/thinking verbs/spinners, customize input box & user message styling, support AGENTS.md, unlock private/unreleased features, and much more. Supports both native/npm installs on all platforms.
