Server configuration
Environment variables
Section titled “Environment variables”| Variable | Required | Purpose |
|---|---|---|
BLITZ_RELAY_CONNECTION_KEY |
Always | Passed to LiteNetLib to authenticate UDP connection requests. |
BLITZ_RELAY_HTTP_ADMIN_TOKEN |
When HTTP is enabled | Bearer token for protected HTTP administration endpoints. |
Blank or whitespace-only required values prevent the server from starting. The HTTP admin token is not required when --disable-http is present.
Command-line options
Section titled “Command-line options”| Option | Alias | Default | Purpose |
|---|---|---|---|
--port <port> |
-p |
7770 |
UDP relay port. |
--http-port <port> |
7771 |
HTTP API TCP port. | |
--disable-http |
false |
Does not create the HTTP API or listener. | |
--log-level <level> |
-l |
Information |
Minimum console log level. |
--cors <path> |
JSON CORS configuration file. |
Accepted log levels are Trace, Debug, Information, Warning, Error, and Critical.
CORS configuration
Section titled “CORS configuration”Without --cors, the HTTP API allows any origin, method, and request header. Credentials are not enabled.
{ "allowedOrigins": ["https://admin.example.com"], "allowedMethods": ["GET", "POST", "PATCH", "DELETE"], "allowedHeaders": ["Authorization", "Content-Type"], "allowCredentials": false}Every property is optional. An omitted or empty origins, methods, or headers array allows any value for that category. Credentials are enabled only when allowedOrigins contains at least one explicit origin.
The server exits with code 1 if the CORS file is missing or cannot be deserialised.
Relay timing
Section titled “Relay timing”| Setting | Value |
|---|---|
| Event polling interval | 15 ms |
| LiteNetLib update interval | 15 ms |
| Ping interval | 2 seconds |
| Peer disconnect timeout | 30 seconds |
| Host claim timeout | 10 seconds |
Backpressure thresholds
Section titled “Backpressure thresholds”For each recipient, unreliable relay traffic is dropped when its reliable queue contains at least 256 packets. A recipient is disconnected before another reliable relay packet is sent when its reliable queue contains at least 2,048 packets.
Unreliable frames that exceed LiteNetLib’s maximum unreliable packet size are dropped. Reliable frames may be fragmented by LiteNetLib.
Shutdown and exit codes
Section titled “Shutdown and exit codes”The UDP server and optional HTTP API share one application lifetime. Stopping either side stops the root application. Normal shutdown returns exit code 0; startup or hosted-service failure returns 1.