mirror of
https://github.com/xjasonlyu/tun2socks.git
synced 2024-12-30 02:37:01 +00:00
a57e1c7197ad085941687d28ab86ed3c87cf5fb3
tun2socks
A tun2socks implementation written in Go.
Features
- External RESTful API support
- Fake DNS with manual hosts support
- IPv4/IPv6 support
- Optimized UDP transmission for game acceleration
- Pure Go implementation, no CGO required
- Socks5, Shadowsocks protocol support for remote connections
- TCP/IP stack powered by gVisor
- Up to 2.5Gbps throughput (10x faster than v1)
Requirements
| Target | Minimum | Recommended |
|---|---|---|
| System | linux darwin | linux |
| Memory | >20MB | +∞ |
| CPU | ANY | amd64 arm64 |
QuickStart
Download from precompiled Releases.
create tun
ip tuntap add mode tun dev tun0
ip addr add 198.18.0.1/15 dev tun0
ip link set dev tun0 up
run
./tun2socks --loglevel WARN --device tun://tun0 --proxy socks5://server:port --interface eth0
or just
PROXY=socks5://server:port LOGLEVEL=WARN sh ./scripts/entrypoint.sh
Build from source
$ git clone https://github.com/xjasonlyu/tun2socks.git
$ cd tun2socks
$ make
Issues
Due to the implementation of pure Go, the memory usage is higher than the previous version. If you are memory sensitive, please go back to v1.
TODO
- Windows support
Credits
Description
tun2socks - powered by gVisor TCP/IP stack
gfwgogolanggvisorhttp-proxynatnetworkproxifier-alternativeproxyshadowsockssocks4socks5ssh-tunneltcpip-stacktortun-devicetun2sockstunneludpwireguard
Readme
6.8 MiB
Languages
Go
95.4%
Makefile
3%
Shell
1.2%
Dockerfile
0.4%