FAQ
Frequently asked questions
01Can I use Xray config files directly?
No. tcptun uses its own JSON topology. Xray compatibility covers wire protocols such as VLESS / VMess / Trojan, not the config format.
02What is the native protocol?
native is tcptun’s private tunnel protocol for tcptun-to-tcptun setups. A typical path is local mixed → native outbound → native inbound → direct, with matching users[].id and token. See the Native guide for a full tutorial and examples.
03How do I run my first native tunnel?
Install tcptun, run tcptun config native --server <host> --port <port>, edit the generated server/client endpoints and token, validate with tcptun config check, start the server then the client, and point apps at 127.0.0.1:1080.
04How do I choose among the four tunnel protocols?
Prefer native for tcptun-to-tcptun throughput, mux, QUIC, and reverse publish. Use vless / vmess / trojan when you need wire interop with Xray-compatible clients or servers.
05How do I validate a config?
Run tcptun config check --config config.json. It validates and compiles without listening on ports.
06Where does one-line install put the binary, and how do I pin a version?
It installs to /usr/local/bin by default. Use TCPTUN_INSTALL_DIR to change the directory and TCPTUN_VERSION to pin a version. The installer downloads platform binaries from the published npm package (cdn.jsdelivr.net/npm/tcptun).
07Which platforms are supported?
macOS, Linux, and Windows on amd64 / arm64 (Linux also includes armv7). Prefer npm install -g tcptun or the one-line installer for CLI builds.
08How is the native token configured?
Server users[].id and client token must match. Use tcptun config native to generate a paired config.
09What is native + raw + reality in v0.2.4?
It is the automatic dual-carrier stack: type=native, transport raw, group mux, and security.type=reality. The server binds TCP and UDP on one address; the client prefers Reality QUIC, falls back to Reality TCP with backoff, and probes to restore QUIC. Camouflage keys/SNI/dest are shared by both carriers. Without mux, Reality stays TCP-only.
10When should I enable mux or QUIC?
For many short connections, prefer mux: {}. In v0.2.4, native + raw + group mux + reality automatically prefers QUIC and falls back to Reality TCP. Use reality-tcp to force TCP, or mux.mode=quic with reality-quic to force QUIC without fallback.
11How do resumable streams work?
Set mux.resume=true on both native endpoints using the Reality-auto stack (raw + group mux + security.type=reality). A TCP logical stream can reattach after its physical QUIC/TCP carrier fails. It does not cover UDP, reverse publish, forced reality-tcp/reality-quic, or cross-process failover; keep it off during rolling upgrades until both peers run v0.2.4 or newer.
12Can REALITY be used together with TLS?
No. REALITY works only with raw and cannot be combined with security.type=tls.
13How should the address field be written?
Both inbound and outbound address values are host:port string arrays. Multiple addresses are candidate entry points for the same logical service and race on first handshake; they are not balance load balancing.
14What is reverse publish?
native + raw + mux (group or QUIC) can publish NAT-side TCP/UDP services to the server: configure publish on the server and expose on the client, with matching service names.
15Is browser-based config generation safe?
Keys and credentials are generated locally with Web Crypto and never uploaded. You can also use the CLI: tcptun config <protocol> --server ….
16How do I convert an Xray config to tcptun?
Paste Xray JSON or vless/vmess/trojan links in Convert. REALITY/TLS and raw/ws/h2/h3 are supported; unsupported transports such as gRPC produce warnings.
17What happens when no config file is provided?
tcptun never searches the current directory for server.json, client.json, or config.json. Without --config it reserves 127.0.0.1:1080, scans private IPv4 LAN peers for SOCKS5:1080, then starts a mixed proxy after the first successful handshake. --retry keeps the listener and retries discovery; it cannot be combined with --config.
18How do I load-balance and switch among outbounds?
Use a balance outbound to group members with weights and affinity_ttl. Multiple addresses on one outbound only race as candidate entry points; they are not load balancing. The embeddable Runtime and Android bridge also support start/stop, probing, and atomic switches of declared outbounds.