Reference for Leviathan server configuration and runtime options.
Leviathan is configured via a single TOML file. On first run, a default file is generated at the OS-specific path below.
Default location:
Platform
Path
Windows
%ProgramData%\leviathan\config.toml (machine-wide — readable by the service supervisor before any user logs in; legacy %APPDATA% configs are migrated forward automatically)
These keys are only meaningful when network.mode = "manual".
Key
Default
Description
external_ip
""
Public IP advertised as a host candidate via WebRTC NAT1To1IPs. Required when port-forwarding.
grpc_port
21218
TCP port the gRPC signaling server listens on. Also used in lan mode.
webrtc_port
0
Fixed UDP port for the shared WebRTC ICE UDP mux. 0 means dynamic ephemeral ports per session.
Note: Leviathan does not run a STUN/TURN client. ICE candidate gathering is the client's responsibility — the server runs in ICE-Lite mode and only responds to connectivity checks.
Upper bound on negotiated stream width. The actual width is requested by the client per-session.
max_height
2160
Upper bound on negotiated stream height.
max_fps
120
Upper bound on capture frame rate. The display's refresh rate ultimately limits this.
default_codec
"hevc"
"hevc" (H.265) or "av1". Clients can override per-session.
encoder
"auto"
Encoder backend. See Encoding for the per-platform mapping.
max_bitrate_kbps
50000
Adaptive bitrate ceiling.
min_bitrate_kbps
1000
Adaptive bitrate floor.
cross_device
false
Force the encoder to allocate its own D3D11 device instead of sharing the capture device (Windows). The pipeline auto-promotes to cross-device when more than one session subscribes to the same display, so this flag is rarely needed manually.
source
"display"
Video input backend. Only "display" is wired up today; "v4l2" is reserved for the RK3588 streaming box backend.
source_device
""
Device identifier when source is not "display" (e.g. /dev/video0).
When a streaming client connects while the machine's user session is parked off-console (typically on RDP) and the physical console sits at a userless lock screen, the service reattaches that session to the console (tscon <sid> /dest:console) and restarts the capture process into it. Without this, capture can only see the console's black lock screen. Any active RDP connection to that session is disconnected by design — the connecting streaming client is assumed to be the machine's owner. On multi-user machines the reattach is skipped when the target session would be ambiguous (several user sessions off-console, none or more than one of them active). Read once at service start: changing it requires a service restart (leviathan service restart).