QUIC-first automatic carriers
With group mux, security.type=reality binds TCP and UDP on one address, dials Reality QUIC first, falls back to Reality TCP with backoff, and probes to restore QUIC preference after recovery.
tcptun is a config-driven multi-inbound, multi-outbound proxy runtime. Describe inbounds, outbounds, and routes in strict JSON, then start TCP/UDP services together.
curl -fsSL https://tcptun.com/install.sh | sh$ curl -fsSL https://tcptun.com/install.sh | sh
$ npm install -g tcptun
$ tcptun --config config.json
$ tcptun config check --config config.json
$ tcptun config native \
--server proxy.example.com \
--port 9443What's new · v0.2.4
v0.2.4 hardens native and Xray mux carrier lifecycle, improves QUIC path recovery, keeps native + raw + reality automatic dual carriers, and refreshes Android bridge logging and VMess interop.
With group mux, security.type=reality binds TCP and UDP on one address, dials Reality QUIC first, falls back to Reality TCP with backoff, and probes to restore QUIC preference after recovery.
v0.2.4 hardens native and Xray mux carrier retirement, stream isolation, and QUIC path recovery so unhealthy carriers fail closed without stranding active streams.
Opt-in mux.resume keeps an eligible TCP logical stream alive while its physical QUIC/TCP attachment is replaced, with bounded replay buffers, recovery timeouts, and a runtime-wide buffer budget.
VMess body security tracks current Xray behavior. The Android bridge exposes dynamic log levels and core build identity for quieter, clearer diagnostics.
Capabilities
From inbound to outbound, one model covers local proxies, tunnels, rule routing, load balancing, and outbound chains.
One config describes the full topology. Inbounds can pin an outbound or let route decide.
address uses host:port arrays; unknown fields are rejected; tags, refs, auth, TLS, REALITY, and mux are validated before start.
Reality auto prefers QUIC and falls back to TCP; opt-in logical streams can resume across carrier replacement.
native mux / QUIC supports publish and expose to hang NAT-side TCP/UDP services on edge ports.
Architecture
Every component has a unique tag; references are compiled and checked before start.
Inbounds
mixedsocks5nativevlessvmesstrojanOutbounds
directbalanceblackholesocks5mixednativevlessvmesstrojan{
"log": { "level": "info" },
"inbounds": [
{
"tag": "local",
"type": "mixed",
"address": ["127.0.0.1:1080"],
"network": ["tcp", "udp"]
}
],
"outbounds": [
{
"tag": "proxy",
"type": "native",
"address": ["proxy.example.com:9443"],
"token": "change-me",
"transport": { "type": "raw" },
"mux": {}
}
],
"route": { "default_outbound": "proxy", "rules": [] },
"dns": {}
}Protocols
Xray compatibility is for wire protocols, not config file format.
Private low-overhead protocol. raw + group mux + reality automatically prefers QUIC and falls back to TCP; resumable streams can preserve eligible TCP flows across carrier replacement.
tcptun config native --server proxy.example.com --port 9443Supports TCP/UDP. Generated configs default to Vision + REALITY and can interoperate with Xray.
tcptun config vless --server proxy.example.com --port 9443VMess AEAD with TCP/UDP support and Xray interop.
tcptun config vmess --server proxy.example.com --port 9443Password-authenticated Trojan tunnel with TCP/UDP support.
tcptun config trojan --server proxy.example.com --port 9443Explore
Step-by-step setup for native + raw + reality: install, generate, validate, run, and test.
Examples02Worked server/client pairs for native auto Reality, resumable streams, reverse publish, VLESS, VMess, and Trojan.
Native guide03Concepts, fields, and long-form notes for the private tunnel protocol.
Chat04Discover users on the same network and exchange messages, configs, and files privately.