# xjasonlyu/tun2socks

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/xjasonlyu-tun2socks).**

4,910 stars · 587 forks · Go · mit

## Links

- GitHub: https://github.com/xjasonlyu/tun2socks
- Homepage: https://github.com/xjasonlyu/tun2socks/wiki
- awesome-repositories: https://awesome-repositories.com/repository/xjasonlyu-tun2socks.md

## Topics

`go` `golang` `gvisor` `http-proxy` `nat` `proxifier` `proxy` `shadowsocks` `socks4` `socks5` `ssh` `ssh-tunnel` `tcpip-stack` `tor` `tun-device` `tun2socks` `udp` `wireguard`

## Description

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.

## Tags

### DevOps & Infrastructure

- [Virtual Network Tunnels](https://awesome-repositories.com/f/devops-infrastructure/virtual-network-tunnels.md) — Implements a virtual network interface to intercept system traffic and redirect it through a transparent proxy. ([source](https://github.com/xjasonlyu/tun2socks/wiki))

### Networking & Communication

- [Transparent Network Proxies](https://awesome-repositories.com/f/networking-communication/transparent-network-proxies.md) — Intercepts and routes all system network traffic transparently through SOCKS5 or HTTP proxies using a virtual interface.
- [Layer 3 Packet Forwarders](https://awesome-repositories.com/f/networking-communication/layer-3-packet-forwarders.md) — Acts as a Layer 3 network gateway to route IPv4 and IPv6 traffic between local devices.
- [Local Proxy Gateways](https://awesome-repositories.com/f/networking-communication/local-proxy-gateways.md) — Functions as a local proxy gateway that forwards traffic from other local devices through a SOCKS5 proxy.
- [Network Traffic Routing](https://awesome-repositories.com/f/networking-communication/network-traffic-routing.md) — Routes network traffic from other devices on the local network by acting as a Layer 3 gateway. ([source](https://cdn.jsdelivr.net/gh/xjasonlyu/tun2socks@main/README.md))
- [SOCKS5 Proxy Tunneling Clients](https://awesome-repositories.com/f/networking-communication/socks5-proxies/socks5-proxy-tunneling-clients.md) — Translates intercepted network packets into SOCKS5 protocol to tunnel all device traffic through a remote proxy.
- [Transparent Proxying](https://awesome-repositories.com/f/networking-communication/transparent-proxying.md) — Redirects application traffic to HTTP, SOCKS, or Shadowsocks proxies without requiring per-app configuration.
- [Virtual Network Interfaces](https://awesome-repositories.com/f/networking-communication/virtual-network-interfaces.md) — Creates a software-defined virtual network interface to intercept system-wide IP packets.
- [IPv6 Network Stacks](https://awesome-repositories.com/f/networking-communication/communication-protocols-architectures/communication-protocols-standards/network-protocols/ipv6-network-stacks.md) — A network utility that tunnels IPv4 traffic over IPv6 or vice versa to ensure cross-protocol compatibility.
- [Multi-Protocol Proxy Clients](https://awesome-repositories.com/f/networking-communication/multi-protocol-proxy-clients.md) — Supports multiple proxy protocols including HTTP, SOCKS4, SOCKS5, and Shadowsocks for flexible traffic routing. ([source](https://cdn.jsdelivr.net/gh/xjasonlyu/tun2socks@main/README.md))
- [Traffic Routing Proxies](https://awesome-repositories.com/f/networking-communication/network-infrastructure-routing/network-infrastructure-configuration/network-infrastructure/traffic-routing-proxies.md) — Directs device network packets through a Shadowsocks proxy to bypass restrictions.
- [Tunneling Protocols](https://awesome-repositories.com/f/networking-communication/network-infrastructure-routing/network-proxying-tools/network-proxies/tunneling-protocols.md) — Implements encapsulation of IPv4 packets within IPv6 headers and vice versa to traverse incompatible network environments.
- [Protocol Translation Tunnels](https://awesome-repositories.com/f/networking-communication/protocol-translation-tunnels.md) — Tunneling IPv4 traffic over IPv6 or vice versa to maintain connectivity across different internet protocol versions.

### Operating Systems & Systems Programming

- [Userspace Stacks](https://awesome-repositories.com/f/operating-systems-systems-programming/systems-programming/bare-metal-development/tcp-ip-stacks/userspace-stacks.md) — Implements a userspace TCP/IP stack to intercept raw IP packets and prepare them for proxy forwarding.
