tun2socks

xjasonlyuMIT活跃维护

用 gVisor 用户态 TCP/IP 栈把 TUN 设备的流量转成 SOCKS4/5、HTTP 代理或 Shadowsocks 出站,让任意程序走代理而无需改配置。

tun2socks - powered by gVisor TCP/IP stack

v2.7.0发布于 2026-07-12 09:48 UTC5,575star +3 / 7 天649fork同步于 2026-11-10 23:36 UTC

怎么上手

由 README 提炼,执行前请确认
README 未给出可直接复制的最小运行命令,安装与示例见 Wiki 的 Install-from-Source 与 Quickstart Examples 页面
硬件要求按 README 说明

README 未说明具体硬件或显存要求;仅说明支持 Linux/macOS/Windows/FreeBSD/OpenBSD,Windows 使用 wintun 作为三层 TUN 驱动。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

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

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v2.7.0
  1. v2.7.0最新正式版2026-07-12 · 2026-07-12 09:48 UTC

    What's Changed

    Features

    Fixes

    Others

    New Contributors

    Full Changelog: https://github.com/xjasonlyu/tun2socks/compare/v2.6.0...v2.7.0

  2. v2.6.02025-06-07 · 2025-06-07 19:46 UTC
    查看更新说明

    What's Changed

    License Update

    New Features

    Improvement & Fixes

    New Contributors

  3. v2.6.0-betapre-release2025-04-15 · 2025-04-15 21:37 UTC
    查看更新说明

    What's Changed

    License Update

    New Features

    Improvement & Fixes

    New Contributors

  4. v2.5.22023-11-13 · 2023-11-13 22:24 UTC
    查看更新说明

    Bug Fixes

    • Fix: HTTP proxy basic auth error (#266)
  5. v2.5.12023-06-07 · 2023-06-07 11:13 UTC
    查看更新说明

    What's Changed

    New Contributors

    Full Changelog: https://github.com/xjasonlyu/tun2socks/compare/v2.5.0...v2.5.1

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    tun2socks

    Go Build Go Linter Go Version Maintainability GitHub License Docker Pulls 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

    Full documentation and technical guides can be found at Wiki.

    Community

    Welcome and feel free to ask any questions at Discussions.

    Credits

    License

    FOSSA Status

    Star History