MCPcopy
hub / github.com/xjasonlyu/tun2socks

github.com/xjasonlyu/tun2socks @v2.6.0 sqlite

repository ↗ · DeepWiki ↗ · release v2.6.0 ↗
475 symbols 1,262 edges 87 files 123 documented · 26%
README

tun2socks

GitHub Workflow Go Version Go Report Maintainability GitHub License Docker Pulls Releases

Features

  • Universal Proxying: Transparently routes all network traffic from any application through a proxy.
  • Multi-Protocol: Supports HTTP/SOCKS4/SOCKS5/Shadowsocks 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

All versions starting from v2.6.0 are available under the terms of the MIT License.

Star History

<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=xjasonlyu/tun2socks&type=Date" />

Extension points exported contracts — how you extend this code

TCPConn (Interface)
TCPConn implements the net.Conn interface. [4 implementers]
core/adapter/adapter.go
Dialer (Interface)
(no doc) [6 implementers]
proxy/proxy.go
Device (Interface)
Device is the interface that implemented by network layer devices (e.g. tun), and easy to use as stack.LinkEndpoint. [2 …
core/device/device.go
StreamConnCipher (Interface)
(no doc) [3 implementers]
transport/shadowsocks/core/cipher.go
Option (FuncType)
(no doc)
core/option/option.go
UDPConn (Interface)
UDPConn implements net.Conn and net.PacketConn. [4 implementers]
core/adapter/adapter.go
Proxy (Interface)
(no doc) [1 implementers]
proxy/proxy.go
PacketConnCipher (Interface)
(no doc) [3 implementers]
transport/shadowsocks/core/cipher.go

Core symbols most depended-on inside this repo

Write
called by 39
transport/simple-obfs/tls.go
Close
called by 23
tunnel/statistic/tracker.go
Addr
called by 21
proxy/proxy.go
Get
called by 14
internal/pool/pool.go
Put
called by 14
buffer/pool.go
Get
called by 14
buffer/allocator/allocator.go
String
called by 13
metadata/metadata.go
Get
called by 11
buffer/pool.go

Shape

Method 204
Function 193
Struct 55
Interface 12
TypeAlias 10
FuncType 1

Languages

Go100%

Modules by API surface

transport/shadowsocks/shadowstream/cipher.go31 symbols
proxy/reject.go21 symbols
tunnel/statistic/tracker.go18 symbols
transport/shadowsocks/shadowstream/stream.go18 symbols
transport/shadowsocks/shadowaead/stream.go18 symbols
transport/socks5/socks5.go17 symbols
transport/shadowsocks/shadowaead/cipher.go17 symbols
transport/shadowsocks/core/cipher.go17 symbols
proxy/relay.go15 symbols
core/option/option.go15 symbols
tunnel/tunnel.go12 symbols
metadata/metadata.go12 symbols

Used by 2 indexed graphs manifest dependencies, hub-wide

Dependencies from manifests, versioned

github.com/ajg/formv1.5.1 · 1×
github.com/davecgh/go-spewv1.1.1 · 1×
github.com/docker/go-unitsv0.5.0 · 1×
github.com/go-chi/corsv1.2.1 · 1×
github.com/go-chi/renderv1.0.3 · 1×
github.com/go-gost/relayv0.5.0 · 1×
github.com/google/btreev1.1.3 · 1×
github.com/google/shlexv0.0.0-2019120210045 · 1×
github.com/gorilla/schemav1.4.1 · 1×

For agents

$ claude mcp add tun2socks \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact