tun2socks is a connectivity utility that functions as a transparent proxy client and Layer 3 network gateway. It routes system network traffic through a SOCKS5 proxy using a virtual tunnel interface and provides the ability to tunnel IPv4 traffic over IPv6 or vice versa.
The project implements a userspace TCP/IP stack to intercept raw IP packets and translate them for transmission to remote proxy servers. It supports multiple proxy protocols, including HTTP, SOCKS4, SOCKS5, and Shadowsocks, allowing application traffic to be redirected without per-app configuration.
The software includes capabilities for Layer 3 packet forwarding, enabling it to act as a gateway for other devices on a local network. It also provides controls for tuning TCP send and receive buffer sizes to balance network throughput and memory usage.