Skip to content

Configuration reference

Configuration can come from a JSON config file, CLI flags, or both. CLI flags take precedence over JSON file values. Defaults are applied for anything not supplied. Both binaries accept -c, --config <PATH>.

Common fields (server + client)

JSON fieldCLI flagMeaningRequiredDefault
server-l, --listen (server) / -s, --server (client)server: UDP bind address; client: remote host:portyes
password-k, --passwordpre-shared password; master key derived from ityes
cipher-m, --cipheraes-128-gcm | aes-256-gcm | chacha20-poly1305nochacha20-poly1305
tun_name--tun-nameexplicit TUN interface name (e.g. utun7, tun0)noOS picks
tun_ip--tun-iplocal IPv4 address on the TUN interfaceyes
tun_netmask--tun-netmaskIPv4 netmask for the TUN interfaceno255.255.255.0
peer_ip--peer-ippoint-to-point peer IPv4 (server: client IP; client: server IP)yes
mtu--mtuTUN interface MTUno1400
obfs(config only)carrier obfuscation: none | quic | base64 — both ends must matchnonone

The alias chacha20-ietf-poly1305 is accepted for cipher and treated as chacha20-poly1305.

Server-only fields

JSON fieldCLI flagMeaningDefault
nat--nattell clients apart by UDP endpoint and NAT them onto internal IPs, so all clients can share one config (NAT mode)false
lease_ttl_secs--lease-ttl-secsNAT mode: reclaim a client's internal-IP lease after this many idle seconds120

Client-only fields

Tunnel behaviour

JSON fieldCLI flagMeaningDefault
keepalive_secs--keepalive-secskeepalive interval in seconds — keep it below the path's UDP NAT timeout15

Policy routing

JSON fieldCLI flagMeaningDefault
mode--modefull | gfwlist | chinadnsfull
dns_listen--dns-listenaddress the split-DNS proxy listens on127.0.0.1:53
dns_local--dns-localdomestic / direct DNS upstream114.114.114.114:53
dns_remote--dns-remoteclean DNS upstream (reached through the tunnel)8.8.8.8:53
gfwlist--gfwlistdomain-suffix file (gfwlist mode; optional force-tunnel list in chinadns mode)auto-discovers a bundled gfwlist.txt
chnroute--chnrouteChina CIDR file (chinadns mode)
geoip--geoipGeoLite2/GeoIP2 .mmdb; builds the China set from it (takes precedence over chnroute)auto-discovers a bundled GeoLite2-Country.mmdb
geoip_country--geoip-countryISO country code to select from the GeoIP databaseCN
set_dns--set-dns / --no-set-dnspoint the system resolver at the proxy (auto-restored on exit)true (needs dns_listen port 53)
prewarm--no-prewarm (disable)list of domains to pre-resolve into the cache on startupbuilt-in list
cache_file--cache-file / --no-cache-persistpersist the DNS cache across restartsdns-cache.json (next to the binary)
dns_timeout_ms(config only)upstream DNS query timeout in milliseconds3000

Maintenance flags

CLI flagMeaning
--restore-dnsrestore the system resolver from the journal left by a run that did not exit cleanly, then exit (no tunnel is brought up). Used by the desktop app to heal DNS after a crashed client.

Full examples

Annotated server and client examples, including NAT mode and policy routing, live in the guides:

Released under the MIT License.