xjasonlyu /tun2socks

tun2socks - powered by gVisor TCP/IP stack

★ 5,580⑂ 649👁 35⑃ 147● 255▤ 36
GoMITCreated 2019-07-16github.com/xjasonlyu/tun2socks
下载:v2.7.0v2.7.0 ↓2.7.02026-07-12
+0
日增长
5,580
stars
649
forks
35
watchers
147
prs
255
issues
36
releases

README

!tun2socks

[![Go Build][1]](https://github.com/xjasonlyu/tun2socks/actions/workflows/docker.yml)
[![Go Linter][2]](https://github.com/xjasonlyu/tun2socks/actions/workflows/linter.yml)
[![Go Version][3]](https://github.com/xjasonlyu/tun2socks/blob/main/go.mod)
[![Maintainability][4]](https://qlty.sh/gh/xjasonlyu/projects/tun2socks)
[![GitHub License][5]](https://github.com/xjasonlyu/tun2socks/blob/main/LICENSE)
[![Docker Pulls][6]](https://hub.docker.com/r/xjasonlyu/tun2socks)
[![Releases][7]](https://github.com/xjasonlyu/tun2socks/releases)

 Features

- Universal Proxying: Transparently routes all network traffic from any application through a proxy.
- Multi-Protocol: Supports HTTP/SOCKS/Shadowsocks/SSH/Relay proxies with optional authentication.
- Cross-Platform: Runs on Linux/macOS/Windows/FreeBSD/OpenBSD with platform-specific optimizations.
- Gateway Mode: Acts as a Layer 3 gateway to route traffic from other devices on the same network.
- Full IPv6 Compatibility: Natively supports IPv6; seamlessly tunnels IPv4 over IPv6 and vice versa.
- User-Space Networking: Leverages the gVisor network stack for enhanced
  performance and flexibility.

 Benchmarks

!benchmark

For all scenarios of usage, tun2socks performs best.
See benchmarks for more details.

 Documentation

- Install from Source
- Quickstart Examples
- Memory Optimization

Full documentation and technical guides can be found at Wiki.

 Community

Welcome and feel free to ask any questions at Discussions.

 Credits

- google/gvisor - Application Kernel for Containers
- wireguard-go - Go Implementation of WireGuard
- wintun - Layer 3 TUN Driver for Windows

 License



 Star History


  
    
    
    
  


[1]: https://img.shields.io/github/actions/workflow/status/xjasonlyu/tun2socks/docker.yml?branch=main&logo=github

[2]: https://img.shields.io/github/actions/workflow/status/xjasonlyu/tun2socks/linter.yml?branch=main&logo=githubactions&label=golangci-lint

[3]: https://img.shields.io/github/go-mod/go-version/xjasonlyu/tun2socks?logo=go

[4]: https://qlty.sh/gh/xjasonlyu/projects/tun2socks/maintainability.svg

[5]: https://img.shields.io/github/license/xjasonlyu/tun2socks

[6]: https://img.shields.io/docker/pulls/xjasonlyu/tun2socks?logo=docker

[7]: https://img.shields.io/github/v/release/xjasonlyu/tun2socks?logo=smartthings

Top issues

Discussions

Latest release

v2.7.0 v2.7.0 2026-07-12
What's Changed

 Features

 Feature: use pflag as drop-in replacement by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/513
 Feature(proxy): support ssh proxy protocol by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/519
 Feature: support custom ICMP message handling by @nange in https://github.com/xjasonlyu/tun2socks/pull/521

 Fixes

 Fix: update gVisor dependency and modify UDP handler to return a boolean by @SuzukiHonoka in https://github.com/xjasonlyu/tun2socks/pull/487
 Fix: crash on multiple start/stop due to FD being closed twice by @vecljox in https:/

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON