You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
xjasonlyu c28690bfc9 Fix: deprecate metadata.Valid method 4 years ago
.github/workflows Chore: ignore all .md files 4 years ago
common Refactor: autonomize core package 4 years ago
component Feature: add fwmark support 4 years ago
constant Fix: deprecate metadata.Valid method 4 years ago
core Refactor: autonomize core package 4 years ago
docker Fix: replace pflag with flag 4 years ago
docs Chore: rewrite README 4 years ago
engine Chore: adjust version output format 4 years ago
log Chore: use strict log level 4 years ago
proxy Refactor: autonomize core package 4 years ago
stats Chore: adjust version output format 4 years ago
tunnel Fix: deprecate metadata.Valid method 4 years ago
.dockerignore Chore: adjust .dockerignore 4 years ago
.gitignore Refactor 4 years ago
Dockerfile Chore: adapt fwmark option 4 years ago
LICENSE License: GPL 3.0 4 years ago
Makefile Chore: adjust version output format 4 years ago
README.md Chore: update README 4 years ago
README_ZH.md Chore: update README 4 years ago
go.mod Fix: replace pflag with flag 4 years ago
go.sum Chore: use gVisor 20210207054208-21036aed5e58 4 years ago
main.go Fix: replace pflag with flag 4 years ago

README.md

tun2socks

GitHub Workflow Go Version Go Report GitHub License Total Lines Releases

English | 简体中文

What is tun2socks?

tun2socks is an application used to "socksify" TCP/UDP (IPv4 and IPv6) traffic at the network layer. It implements a TUN virtual network interface which accepts all incoming TCP/UDP packets and forwards them through a SOCKS server.

Features

  • ICMP echoing / IPv6 support / Socks5 & SS proxy
  • SO_BINDTODEVICE & SO_MARK option support
  • Optimized UDP transmission for game acceleration
  • Pure Go implementation, no more CGO required
  • Router mode, routing all the traffic in LAN
  • TCP/IP stack powered by gVisor
  • More than 2.5Gbps throughput (10x faster than v1)

Requirements

Target Minimum Recommended
System Linux MacOS Freebsd OpenBSD Windows Linux or MacOS
Memory >20MB >128MB
CPU AMD64(x86_64) ARM64 AMD64 with AES-NI & AVX2

Documentation

Documentations and quick start guides can be found at Github Wiki.

Building from source

Due to the limitation of gVisor, tun2socks only supports x86_64 and ARM64 for now. Other architectures may become available in the future.

Environments

Make sure the following dependencies are installed:

  • Go 1.15+

Building

Build and install the tun2socks binary:

make tun2socks
sudo cp ./bin/tun2socks /usr/local/bin

Build for all architectures:

make all-arch

Credits