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
| Field | Type | Default | Description |
|---|---|---|---|
port | int | 8080 | Main HTTP/REST API and streaming port. |
debug | bool | false | Enables debug logging, Gin debug routes, and /debug/statsviz. |
pprof_port | int | 0 | Dedicated continuous profiling port (6060 recommended; 0 disables). |
record_retention_days | int | 0 | Global archive retention period in days (0 = infinite). |
gc_percent | int | 50 | GOGC tuning value (default: 50 for reduced memory fragmentation). |
gc_memory_limit_mb | int | 0 | GOMEMLIMIT in Megabytes to avoid OOM crashes (e.g. 2048). |
cors_allowed_origins | []string | [] | Allowed CORS origins. Leave empty to disable CORS. |
grpc | object | — | Internal frame streaming and AI metadata service. |
grpc.address | string | "0.0.0.0" | Bind address for the gRPC server. |
grpc.port | int | 50051 | Port for the gRPC server. |
tls | object | — | Native TLS encryption settings. |
tls.cert_file | string | "" | Path to TLS certificate PEM file. |
tls.key_file | string | "" | Path to TLS private key PEM file. |
webrtc | object | — | WebRTC WHEP connection settings. |
webrtc.listen_port | int | 0 | Fixed 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_policy | string | "all" | ICE policy ("all" or "relay" to force TURN). |
webrtc.turn_username | string | "" | Username for TURN authentication. |
webrtc.turn_password | string | "" | 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"