Compiled topology
FileConfig is validated and compiled before any listener opens. Unknown fields fail closed.
tcptun compiles routing, tunnels, transports, and platform networking into one strict, observable runtime. Run it as a CLI, embed it in Go, or integrate it into Android VPN clients.
Run as CLI runtime, Android VPN client, embedded Go library, or platform networking engine.
$ curl -fsSL https://tcptun.com/install.sh | sh
$ npm install -g tcptun
$ tcptun --config config.json
$ tcptun config check --config config.json
# Go module
import "pkg.tcptun.com/net"What is tcptun?
tcptun loads a strict JSON topology, compiles outbounds and routes, prepares every inbound, then serves them together. The same engine powers the CLI, Go embeddings, and Android integrations. Protocol count is secondary; the model is primary.
Choose your path
Install the binary, generate a strict JSON topology, validate, and serve inbounds together.
Continue →EmbedImport pkg.tcptun.com/net and compose dialers, listeners, packet devices, and routing in process.
Continue →IntegrateAndroid client v0.5.1 embeds tcptun-go v0.5.0, matching the CLI core. VPN profiles require TLS or REALITY.
Continue →Core capabilities
Capability list after positioning — so new readers already know tcptun is an engine, not a single-purpose tunnel utility.
FileConfig is validated and compiled before any listener opens. Unknown fields fail closed.
One process hosts mixed proxies, tunnels, reverse publish, balance groups, and rule routing.
tcptun-to-tcptun Native protocol with mux, carrier.mode selection, and optional resumable streams.
Mux pools, resume buffers, and packet paths are budgeted so long-lived services stay predictable.
TUN, DNS interception / fake-IP, and Android bridge hooks for device-level integration.
mixed and socks5 hops with users[] and SOCKS5 secure auth v2 (HKDF method 0x80). Tunnel endpoints are native only.
Architecture
FileConfig is decoded with unknown-field rejection, compiled into RuntimeConfig, then bound. Fail closed before traffic is accepted.
Strict JSON topology
Tags, refs, auth, caps
Compiled graph
TCP · UDP · TUN · routes
Protocols
v0.5.0 tunnel endpoints are native only. mixed and socks5 remain for authenticated local/LAN proxy hops.
Native
Optimized for TCP/QUIC carriers, mux, resumable streams, reverse publishing, resource control, and tcptun-to-tcptun deployments.
Native guide →Local proxy
Authenticated local listeners and LAN hops with users[] and SOCKS5 secure auth v2.
Config reference →Latest · v0.5.0
Release notes stay technical: native-only tunnels, carrier.prefer, SOCKS5 secure auth v2, idle power-save probes, and mux stall recovery. Version lives here — not in the document title for SEO.
v0.4.0+ tunnel endpoints are native only. mixed and socks5 remain for local/LAN proxy hops.
native + raw + mux can set carrier.mode=auto with TLS or REALITY. Outbound carrier.prefer is adaptive (default), quic, or tcp: strict preferences use the healthy preferred carrier and fall back only while it is unavailable.
Credentialed SOCKS5/mixed outbounds default to auth_mode=secure (HKDF method 0x80, no RFC1929 downgrade). Authenticated inbounds use a bounded users[] array across mixed, socks5, and native.
A low-wakeup power profile parks idle QUIC probes on platform inbounds. Mux retires silently stalled carriers, backpressures elephant streams, and bounds local accept recovery independently of outbound backoff.
v0.5.0 can route IPv4/IPv6 TCP/UDP to a Home Connector, with optional Edge-assisted direct QUIC and relay fallback. Android does not expose Reverse Subnet / P2P in the product UI.
Security & trust
Inspect installers, verify package provenance, and read how the runtime validates config before binding ports.
curl -fsSL https://tcptun.com/install.sh | sh