tun2socks is a user-space network proxy tool that transparently routes traffic through a TUN device using the gVisor TCP/IP stack.
The tool solves the problem of routing all network traffic from applications through proxy servers without requiring application-level changes. It works by creating a virtual network interface that intercepts traffic and processes it through a user-space TCP/IP stack powered by gVisor, then forwards connections through supported proxy protocols including HTTP, SOCKS, Shadowsocks, SSH, and relay proxies. This approach enables transparent proxying across the entire system while maintaining flexibility in proxy selection and authentication.
Developers should choose this tool when they need system-wide transparent proxying across multiple applications and protocols. It suits scenarios ranging from personal workstations to gateway deployments that route traffic from other devices on the network. The tool runs on Linux, macOS, Windows, FreeBSD, and OpenBSD with platform-specific optimizations. It natively supports IPv6 and can tunnel IPv4 over IPv6 and vice versa. The README does not compare tun2socks to alternative proxying solutions, so no comparative guidance can be offered.
The project maintains active community engagement through a discussions forum. Documentation is comprehensive, covering installation from source, quickstart examples, and memory optimization techniques. The tool includes benchmarking results demonstrating performance characteristics across different usage scenarios.