Skip to content

Edge Configuration Reference ​

Complete reference for Edge server config.yaml configuration items


📋 Overview ​

Edge server controls all features via YAML configuration files. The config file path is specified via --config parameter, defaulting to ~/.yat/config.yml.

Configuration Loading Order ​

Defaults → YAML file overrides → Startup config injection (Captain) → CLI parameter overrides

Later-loaded configuration overrides earlier values.

Configuration File Example ​

For a complete configuration template, see config.example.yaml.


📑 Configuration Items ​

1. Node Identity (node) ​

Defines the Edge node's basic identity information.

Config KeyTypeDefaultDescription
node.zonestring"default"Node zone, e.g. cn-east-1
node.typestring"private"Node type: private / public / shared
node.public_addressstringemptyEdge public address, format IP:PORT or DOMAIN:PORT. Used as AdvertiseHost for P2P hole punching

About node.id

node.id doesn't need manual configuration. Edge automatically resolves it from the EDGE_SECRET environment variable at startup. Format: {edge_id}.{token}.

Example:

yaml
node:
  zone: "cn-east-1"
  type: "private"
  public_address: "203.0.113.1:9000"

2. Controller Connection (controller) ​

Configure Edge's connection to the Captain control plane.

Config KeyTypeDefaultDescription
controller.addressstring"captain.tunnel6.com:8808"Captain server address
controller.heartbeat_intervalduration30sHeartbeat interval
controller.reconnect_intervalduration5sReconnect interval on disconnect

2.1 TLS Configuration (controller.tls) ​

Config KeyTypeDefaultDescription
controller.tls.enabledbooltrueEnable TLS (must be enabled in production)
controller.tls.castringemptyCA certificate path, leave empty to use embedded CA
controller.tls.certstringemptyTLS certificate path
controller.tls.keystringemptyTLS private key path

2.2 Certificate Bootstrap (controller.bootstrap) ​

Edge automatically obtains certificates via the Bootstrap process on first startup.

Config KeyTypeDefaultDescription
controller.bootstrap.registration_secretstringemptyRegistration secret, uses EDGE_SECRET env var if empty
controller.bootstrap.datastringPlatform defaultData directory path (see table below)
controller.bootstrap.client_cert_validityduration8760h (1 year)Client certificate validity

Data Directory Defaults:

PlatformDefault Path
Linux/var/lib/edge
macOS~/.edge
Other./data

The data directory stores:

  • edge-id — Edge unique identifier
  • assigned-domain — Captain-assigned domain
  • root-ca.crt — Root CA certificate
  • edge-tls.crt / edge-tls.key — Edge TLS certificate pair

Example:

yaml
controller:
  address: "captain.yat.io:8808"
  heartbeat_interval: 30s
  reconnect_interval: 5s
  tls:
    enabled: true
  bootstrap:
    registration_secret: ""
    data: "/var/lib/edge"
    client_cert_validity: 8760h

3. Tunnel Service (tunnel) ​

Configure Edge's tunnel listening and session management.

Config KeyTypeDefaultDescription
tunnel.listenstring"0.0.0.0:9000"Tunnel listen address
tunnel.max_sessionsint1000Max concurrent sessions
tunnel.session_timeoutduration5mSession timeout

3.1 Tunnel Limits (tunnel.limits) ​

Config KeyTypeDefaultDescription
tunnel.limits.max_per_sessionint0Max tunnels per user session, 0 = unlimited
tunnel.limits.max_totalint0Max total tunnels for this edge, 0 = unlimited

3.2 Tunnel TLS (tunnel.tls) ​

Config KeyTypeDefaultDescription
tunnel.tls.enabledbooltrueEnable TLS
tunnel.tls.castringemptyAuto-uses root-ca.crt from data directory if empty
tunnel.tls.certstringemptyAuto-uses edge-tls.crt from data directory if empty
tunnel.tls.keystringemptyAuto-uses edge-tls.key from data directory if empty

Example:

yaml
tunnel:
  listen: "0.0.0.0:9000"
  max_sessions: 1000
  session_timeout: 5m
  limits:
    max_per_session: 5
    max_total: 1000
  tls:
    enabled: true

4. Protocol Proxies (proxy) ​

Edge supports multiple protocol proxies, each independently configured.

4.1 HTTP Proxy (proxy.http) ​

Config KeyTypeDefaultDescription
proxy.http.enabledbooltrueEnable HTTP proxy
proxy.http.portint80HTTP public port
proxy.http.https_portint443HTTPS public port
proxy.http.addrstringemptyListen address, empty uses :<port>
proxy.http.timeoutduration30sRequest timeout
proxy.http.bufferstring"16K"Read buffer size, supports K/M suffix
proxy.http.buffer_lockboolfalseLock buffer to fixed size, disable dynamic window
proxy.http.eager_startboolfalseStart HTTP proxy immediately on boot

About HTTPS Certificates

proxy.http.https_server_cert and proxy.http.https_server_key are local-only fields for specifying HTTPS certificate paths, not reported to Captain. Usually left empty and managed automatically.

Example:

yaml
proxy:
  http:
    enabled: true
    port: 80
    https_port: 443
    timeout: 30s
    buffer: "16K"

4.2 TCP Proxy (proxy.tcp) ​

Config KeyTypeDefaultDescription
proxy.tcp.enabledbooltrueEnable TCP proxy
proxy.tcp.port_minint30000Port range start
proxy.tcp.port_maxint40000Port range end

Example:

yaml
proxy:
  tcp:
    enabled: true
    port_min: 30000
    port_max: 40000

4.3 UDP Proxy (proxy.udp) ​

Config KeyTypeDefaultDescription
proxy.udp.enabledbooltrueEnable UDP proxy
proxy.udp.port_minint30000Port range start
proxy.udp.port_maxint40000Port range end

Example:

yaml
proxy:
  udp:
    enabled: true
    port_min: 30000
    port_max: 40000

4.4 WireGuard (proxy.wireguard) ​

WireGuard networking configuration. See WireGuard Configuration Guide for detailed setup.

Config KeyTypeDefaultDescription
proxy.wireguard.enabledboolfalseEnable WireGuard
proxy.wireguard.interfacestring"wg0"WireGuard interface name
proxy.wireguard.subnetstring"10.0.0.1/24"WireGuard subnet
proxy.wireguard.interface_prefixstring"wg-yat0"Interface name prefix
proxy.wireguard.listen_port_baseint58021WG interface listen port base
proxy.wireguard.key_dirstringemptyKey storage directory
proxy.wireguard.public_endpointstringemptyEdge public address (without port)
proxy.wireguard.relay_enabledboolfalseEnable Edge-side relay forwarding
proxy.wireguard.forwarder_strategystringemptyForwarding strategy: kernel (default) / ebpf (experimental, requires Linux 5.8+)
proxy.wireguard.default_peer_rateint0Per-peer guaranteed bandwidth (bytes/sec), 0 = unlimited
proxy.wireguard.default_peer_ceilint0Per-peer burst ceiling (bytes/sec), 0 = same as default_peer_rate

Example:

yaml
proxy:
  wireguard:
    enabled: true
    subnet: "10.0.0.1/24"
    relay_enabled: true
    forwarder_strategy: "kernel"
    default_peer_rate: 125000    # 1 Mbps
    default_peer_ceil: 500000    # 4 Mbps

4.5 P2P / ICE (proxy.ice) ​

P2P direct connection uses ICE protocol for NAT traversal.

Config KeyTypeDefaultDescription
proxy.ice.enabledboolfalseEnable ICE P2P hole punching
proxy.ice.udp_addrstringemptyP2P UDP listen address, e.g. 0.0.0.0:9000
proxy.ice.udp_addr_altstringemptyAlternative UDP listen address

Configure via channel.p2p

Recommended to configure P2P via channel.p2p, which automatically maps to proxy.ice:

  • channel.p2p.enabled → proxy.ice.enabled
  • channel.p2p.udp_addr → proxy.ice.udp_addr (auto-enables ICE when set)

5. Channel Business (channel) ​

Configure channel-related business parameters.

Config KeyTypeDefaultDescription
channel.custom_domainstringemptyCustom domain (user's own domain)
channel.alias_domain_policystring"optional"Alias domain policy: disabled / optional / required
channel.max_channels_per_userint10Max channels per user
channel.max_bandwidth_mbpsint100Max bandwidth (Mbps)

5.1 P2P Configuration (channel.p2p) ​

This is the recommended configuration entry for P2P, which automatically maps to proxy.ice.

Config KeyTypeDefaultDescription
channel.p2p.enabledboolemptyEnable P2P direct connection. Auto-enabled when udp_addr is set
channel.p2p.udp_addrstringemptyP2P UDP listen address, e.g. 0.0.0.0:9000

Example:

yaml
channel:
  custom_domain: ""
  max_channels_per_user: 10
  max_bandwidth_mbps: 100
  p2p:
    enabled: true
    udp_addr: "0.0.0.0:9000"

6. Logging (log) ​

Config KeyTypeDefaultDescription
log.outputstringemptyOutput mode: console / file
log.filestringemptyLog file path (effective when output=file)
log.levelstringemptyLog level: debug / info / warn / error / fatal / panic

Example:

yaml
log:
  output: "file"
  file: "./certs/edge.log"
  level: "info"

7. Billing (billing) ​

Config KeyTypeDefaultDescription
billing.enabledbooltrueEnable billing
billing.owner_bypassbooltrueOwner exempt from billing
billing.cache_durationduration5mBilling cache duration

🔧 Configuration Override Priority ​

When the same parameter is set by multiple sources, the following priority applies (high → low):

PrioritySourceDescription
1 (highest)CLI Parametersedge server start --xxx command-line arguments
2Startup Config InjectionCaptain-delivered --startup.config_b64 / --startup.config_json
3YAML Config FileValues in config.yaml
4 (lowest)DefaultsBuilt-in default values in code

📝 Complete Configuration Example ​

A typical production configuration:

yaml
# Node identity
node:
  zone: "cn-east-1"
  type: "private"
  public_address: "203.0.113.1:9000"

# Controller connection
controller:
  address: "captain.yat.io:8808"
  heartbeat_interval: 30s
  reconnect_interval: 5s
  tls:
    enabled: true
  bootstrap:
    registration_secret: ""
    data: "/var/lib/edge"
    client_cert_validity: 8760h

# Tunnel service
tunnel:
  listen: "0.0.0.0:9000"
  max_sessions: 1000
  session_timeout: 5m
  limits:
    max_per_session: 5
    max_total: 1000
  tls:
    enabled: true

# Logging
log:
  output: "file"
  file: "/var/log/edge.log"
  level: "info"

# Protocol proxies
proxy:
  http:
    enabled: true
    port: 80
    https_port: 443
    timeout: 30s
    buffer: "16K"

  tcp:
    enabled: true
    port_min: 30000
    port_max: 40000

  udp:
    enabled: true
    port_min: 30000
    port_max: 40000

  wireguard:
    enabled: true
    subnet: "10.0.0.1/24"
    relay_enabled: true
    forwarder_strategy: "kernel"

# Channel business
channel:
  max_channels_per_user: 10
  max_bandwidth_mbps: 100
  p2p:
    enabled: true
    udp_addr: "0.0.0.0:9000"


YAT Team - Making intranet penetration simpler

Released under the MIT License.