FileConfig
Strict JSON topology with unknown-field rejection. Inbounds, outbounds, route, DNS, and resource budgets.
Architecture
How tcptun compiles FileConfig into a fail-closed networking runtime: validation, RuntimeConfig, TCP/UDP/TUN, and routing.
Pipeline
Configuration (JSON)
|
v
FileConfig
|
validate
|
compile
|
RuntimeConfig
|
v
Networking Runtime
| | | |
TCP UDP TUN RoutingStrict JSON topology with unknown-field rejection. Inbounds, outbounds, route, DNS, and resource budgets.
Unique tags, reference integrity, auth material, transport/security combos, and capability checks before bind.
Produce RuntimeConfig: compiled outbound graph, route table, and prepared listeners — not ad-hoc runtime parsing.
One process serves TCP, UDP, TUN, reverse publish, and packet paths with shared routing and diagnostics.
Properties
Invalid config never partially starts. DNS fake-IP and routing refuse unsafe fallbacks when validation fails.
Rules and default_outbound are compiled; balance and chain hops are cycle-checked and finite.
Mux pools, resume buffers, and packet paths use explicit budgets so memory behavior stays predictable.
Log levels, bridge identity, and runtime statistics surface for operators and embedders.