README 未给出安装命令,需先按 Wiki 的 Install-from-Source 或 Quickstart Examples 操作;Windows 依赖 wintun 驱动;具体代理参数与运行方式需查阅 Wiki 示例

README 未给出可直接复制的最小运行命令,安装与示例见 Wiki 的 Install-from-Source 与 Quickstart Examples 页面 硬件要求按 README 说明
README 未说明具体硬件或显存要求;仅说明支持 Linux/macOS/Windows/FreeBSD/OpenBSD,Windows 使用 wintun 作为三层 TUN 驱动。
基于 gVisor 用户态网络栈的 tun2socks,把任意应用的流量透明转发到代理
用 gVisor 用户态 TCP/IP 栈把 TUN 设备的流量转成 SOCKS4/5、HTTP 代理或 Shadowsocks 出站,让任意程序走代理而无需改配置。
核心能力
- 透明转发任意应用的网络流量到代理
- 支持 HTTP/SOCKS/Shadowsocks/SSH/Relay 多种代理协议
- 可作为三层网关为同网段其他设备转发流量
- 原生支持 IPv6,并可在 IPv4 与 IPv6 间互相隧道
- 基于 gVisor 用户态网络栈实现,跨 Linux/macOS/Windows/FreeBSD/OpenBSD
容易踩的坑
内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README
- v2.7.0最新正式版2026-07-12 · 2026-07-12 09:48 UTC
What's Changed
Features
- Feature: use
pflagas 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://github.com/xjasonlyu/tun2socks/pull/495
- Fix(log): set log level for
glogby @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/511 - Fix(stack): respond to ICMPv4 echo messages by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/514
- Fix: icmp interface binding by @nange in https://github.com/xjasonlyu/tun2socks/pull/524
- Fix(build): remove unsupported windows/arm32 target by @xjasonlyu with @Copilot in https://github.com/xjasonlyu/tun2socks/pull/542
Others
- Refactor(proxy): registrable proxy protocol by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/517
- Refactor(engine): parse multicast groups by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/518
- Refactor(dialer): with socket options by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/525
- Refactor: ID should return a copy for TCP/UDPConn by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/522
- CI: add tun2socks e2e tests by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/510
- CI(test): update test workflow by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/516
- Chore: bump to go1.26 by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/526
New Contributors
- @vecljox made their first contribution in https://github.com/xjasonlyu/tun2socks/pull/495
- @xjasonlyu with @Copilot made their first contribution in https://github.com/xjasonlyu/tun2socks/pull/542
Full Changelog: https://github.com/xjasonlyu/tun2socks/compare/v2.6.0...v2.7.0
- Feature: use
- v2.6.02025-06-07 · 2025-06-07 19:46 UTC
查看更新说明
What's Changed
License Update
- LICENSE: switch to MIT by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/462
New Features
- Feature: fdbased open fd with offset by @myloft in https://github.com/xjasonlyu/tun2socks/pull/272
- Feature: Add support for multicast by @Amaindex in https://github.com/xjasonlyu/tun2socks/pull/245
- Feature: persistent wintun with GUID option by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/301
- Feature: set open FD offset for iOS by @hossinasaadi in https://github.com/xjasonlyu/tun2socks/pull/418
- Feature: add make for loong64 by @xunmi-git in https://github.com/xjasonlyu/tun2socks/pull/427
- Feature(proxy): support gost relay protocol by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/310
- Feature(docker): add options for multicast groups by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/290
- Feature(socks5): support abstract namespace unix sock by @SuzukiHonoka in https://github.com/xjasonlyu/tun2socks/pull/436
Improvement & Fixes
- Improve(actions): add concurrency groups by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/289
- Improve: use embedded
go-shadowsocks2by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/306 - Improve(proxy/ss): allow explicit none cipher mode by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/312
- Improve: optimize the memory footprint under SOCKS5 when USERNAME/PASSWORD authentication is used by @cty123 in https://github.com/xjasonlyu/tun2socks/pull/315
- Fix: defer func for
safeConnCloseby @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/309 - Fix: call SetSendBufferSize when setting send buffer size option by @niconorsk in https://github.com/xjasonlyu/tun2socks/pull/336
- Fix: safely split command strings by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/340
- Fix: socks5 usernames and passwords can BOTH be up to 255 bytes by @Yawning in https://github.com/xjasonlyu/tun2socks/pull/343
- Fix: codeql autobuild error by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/355
- Fix: mutex never unlocked on error by @devil666face in https://github.com/xjasonlyu/tun2socks/pull/456
- Refactor: direct proxy parsing by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/308
- Refactor(debug): simplify version string by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/380
- Refactor(log): use
go.uber.org/zapby @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/389 - Refactor(tunnel): modularize tunnel pkg by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/393
- Refactor(core): replace net.IP with netip.Addr by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/395
- Refactor(metadata): replace net.IP with netip.Addr by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/396
- Refactor(socks): replace net.IP with netip.Addr by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/397
- Refactor(pool): move to internal by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/398
- Refactor(pool): use generic buffer/pool by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/399
- Refactor: bufferpool new function by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/407
- Refactor(dialer): use
DefaultDialerby @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/465
New Contributors
- @Amaindex made their first contribution in https://github.com/xjasonlyu/tun2socks/pull/245
- @cty123 made their first contribution in https://github.com/xjasonlyu/tun2socks/pull/315
- @niconorsk made their first contribution in https://github.com/xjasonlyu/tun2socks/pull/336
- @Yawning made their first contribution in https://github.com/xjasonlyu/tun2socks/pull/343
- @dependabot made their first contribution in https://github.com/xjasonlyu/tun2socks/pull/370
- @hossinasaadi made their first contribution in https://github.com/xjasonlyu/tun2sock
- v2.6.0-betapre-release2025-04-15 · 2025-04-15 21:37 UTC
查看更新说明
What's Changed
License Update
- LICENSE: switch to MIT by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/462
New Features
- Feature: fdbased open fd with offset by @myloft in https://github.com/xjasonlyu/tun2socks/pull/272
- Feature: Add support for multicast by @Amaindex in https://github.com/xjasonlyu/tun2socks/pull/245
- Feature: persistent wintun with GUID option by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/301
- Feature: set open FD offset for iOS by @hossinasaadi in https://github.com/xjasonlyu/tun2socks/pull/418
- Feature: add make for loong64 by @xunmi-git in https://github.com/xjasonlyu/tun2socks/pull/427
- Feature(proxy): support gost relay protocol by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/310
- Feature(docker): add options for multicast groups by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/290
- Feature(socks5): support abstract namespace unix sock by @SuzukiHonoka in https://github.com/xjasonlyu/tun2socks/pull/436
Improvement & Fixes
- Improve(actions): add concurrency groups by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/289
- Improve: use embedded
go-shadowsocks2by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/306 - Improve(proxy/ss): allow explicit none cipher mode by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/312
- Improve: optimize the memory footprint under SOCKS5 when USERNAME/PASSWORD authentication is used by @cty123 in https://github.com/xjasonlyu/tun2socks/pull/315
- Fix: defer func for
safeConnCloseby @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/309 - Fix: call SetSendBufferSize when setting send buffer size option by @niconorsk in https://github.com/xjasonlyu/tun2socks/pull/336
- Fix: safely split command strings by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/340
- Fix: socks5 usernames and passwords can BOTH be up to 255 bytes by @Yawning in https://github.com/xjasonlyu/tun2socks/pull/343
- Fix: codeql autobuild error by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/355
- Fix: mutex never unlocked on error by @devil666face in https://github.com/xjasonlyu/tun2socks/pull/456
- Refactor: direct proxy parsing by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/308
- Refactor(debug): simplify version string by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/380
- Refactor(log): use
go.uber.org/zapby @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/389 - Refactor(tunnel): modularize tunnel pkg by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/393
- Refactor(core): replace net.IP with netip.Addr by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/395
- Refactor(metadata): replace net.IP with netip.Addr by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/396
- Refactor(socks): replace net.IP with netip.Addr by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/397
- Refactor(pool): move to internal by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/398
- Refactor(pool): use generic buffer/pool by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/399
- Refactor: bufferpool new function by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/407
- Refactor(dialer): use
DefaultDialerby @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/465
New Contributors
- @Amaindex made their first contribution in https://github.com/xjasonlyu/tun2socks/pull/245
- @cty123 made their first contribution in https://github.com/xjasonlyu/tun2socks/pull/315
- @niconorsk made their first contribution in https://github.com/xjasonlyu/tun2socks/pull/336
- @Yawning made their first contribution in https://github.com/xjasonlyu/tun2socks/pull/343
- @dependabot made their first contribution in https://github.com/xjasonlyu/tun2socks/pull/370
- @hossinasaadi made their first contribution in https://github.com/xjasonlyu/tun2sock
- v2.5.22023-11-13 · 2023-11-13 22:24 UTC
查看更新说明
Bug Fixes
- Fix: HTTP proxy basic auth error (#266)
- v2.5.12023-06-07 · 2023-06-07 11:13 UTC
查看更新说明
What's Changed
- Feature: log support setting output by @myloft in https://github.com/xjasonlyu/tun2socks/pull/248
- CI: update golangci-lint config by @xjasonlyu in https://github.com/xjasonlyu/tun2socks/pull/251
- Fix: packets sending issue on certain Linux platform by @xjasonlyu in #254
- Fix: fix panic when unassigned reply code arrives. by @ghostiam in https://github.com/xjasonlyu/tun2socks/pull/255
New Contributors
- @ghostiam made their first contribution in https://github.com/xjasonlyu/tun2socks/pull/255
Full Changelog: https://github.com/xjasonlyu/tun2socks/compare/v2.5.0...v2.5.1
用户点评
登录用户的真实使用记录,可按版本和硬件筛选共 0 条
还没有人点评。第一个说出真实体验的人最有价值。

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

For all scenarios of usage, tun2socks performs best. See benchmarks for more details.
Documentation
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