tcptun

Examples

Worked examples for every tunnel protocol.

Complete server / client pairs for native Reality auto, resumable streams, reverse publish, balance, route split, VLESS, VMess, and Trojan. Copy, replace placeholders, validate, then start the server first.

native

native · basic proxy

tcptun-to-tcptun tunnel with raw + mux for throughput.

When: Both ends run tcptun and you want low overhead.

  1. Generate with tcptun config native.
  2. Match users[].id and token.
  3. Start server, then client; use 127.0.0.1:1080.
tcptun config native --server proxy.example.com --port 9443
tcptun config check --config server.json
tcptun --config server.json
tcptun --config client.json
server-native.json
{
  "log": { "level": "info" },
  "inbounds": [
    {
      "tag": "server",
      "type": "native",
      "address": ["0.0.0.0:9443"],
      "network": ["tcp", "udp"],
      "users": [{ "id": "change-me" }],
      "transport": { "type": "raw" },
      "mux": {}
    }
  ],
  "outbounds": [
    { "tag": "direct", "type": "direct" }
  ],
  "route": { "default_outbound": "direct", "rules": [] },
  "dns": {}
}