Skip to content

Server Configuration

The server section in config.yaml configures HTTP/gRPC ports, native TLS, WebRTC ICE/TURN parameters, and runtime memory optimization.

Full Reference Table

FieldTypeDefaultDescription
portint8080Main HTTP/REST API and streaming port.
debugboolfalseEnables debug logging, Gin debug routes, and /debug/statsviz.
pprof_portint0Dedicated continuous profiling port (6060 recommended; 0 disables).
record_retention_daysint0Global archive retention period in days (0 = infinite).
gc_percentint50GOGC tuning value (default: 50 for reduced memory fragmentation).
gc_memory_limit_mbint0GOMEMLIMIT in Megabytes to avoid OOM crashes (e.g. 2048).
cors_allowed_origins[]string[]Allowed CORS origins. Leave empty to disable CORS.
grpcobjectInternal frame streaming and AI metadata service.
grpc.addressstring"0.0.0.0"Bind address for the gRPC server.
grpc.portint50051Port for the gRPC server.
tlsobjectNative TLS encryption settings.
tls.cert_filestring""Path to TLS certificate PEM file.
tls.key_filestring""Path to TLS private key PEM file.
webrtcobjectWebRTC WHEP connection settings.
webrtc.listen_portint0Fixed UDP port for WebRTC UDP Muxer (e.g., 8555).
webrtc.nat_1_to_1_ips[]string[]Public/External IP addresses for ICE host candidates.
webrtc.ice_servers[]string[]List of STUN/TURN URLs (e.g., ["stun:stun.l.google.com:19302"]).
webrtc.ice_transport_policystring"all"ICE policy ("all" or "relay" to force TURN).
webrtc.turn_usernamestring""Username for TURN authentication.
webrtc.turn_passwordstring""Password for TURN authentication.

Production Example

yaml
server:
  port: 8080
  debug: false
  pprof_port: 6060
  record_retention_days: 14
  gc_percent: 50
  gc_memory_limit_mb: 2048
  cors_allowed_origins:
    - "http://localhost:8080"
    - "https://vms.company.local"
  grpc:
    address: "0.0.0.0"
    port: 50051
  tls:
    cert_file: "/etc/ssl/certs/ruseon.crt"
    key_file: "/etc/ssl/private/ruseon.key"
  webrtc:
    listen_port: 8555
    nat_1_to_1_ips:
      - "203.0.113.10"
    ice_servers:
      - "stun:stun.l.google.com:19302"
      - "turn:turn.company.local:3478"
    ice_transport_policy: "all"
    turn_username: "webrtc_user"
    turn_password: "super_secret_turn_password"

Released under the MIT License.