NetworkServerLibrary.
Remarks
Resolved viaregisterEnv(ServerConfigNetwork, ctx.env) during __init.
Extends
Constructors
Constructor
new ServerConfigNetwork(): ServerConfigNetwork
Returns
ServerConfigNetwork
Inherited from
NetworkConfig.constructor
Properties
ADVERTISE_IP?
Defined in: modules/network/src/server/config.server.network.ts:92 Public address to advertise in host ICE candidates.optionalADVERTISE_IP?:string
Remarks
Set this when the address the server sees on its own interfaces is not the one clients must send to — a Kubernetes pod IP, a container bridge address, or a LAN address behind a port forward. Onlytyp host
candidates are rewritten; addresses discovered through STUN are already
public and are left untouched.
ICE_PORT?
Defined in: modules/network/src/server/config.server.network.ts:77 Fixed UDP port for the WebRTC transport.optionalICE_PORT?:string
Remarks
Without it every peer gets a random port, which cannot be expressed as a firewall rule, a port forward or a KubernetescontainerPort. Setting it
enables ICE UDP multiplexing, so every client shares this one port.
ICE_SERVERS
ICE_SERVERS: RTCIceServer[]
Defined in: modules/network/src/shared/config.network.ts:67
STUN and TURN servers used while gathering ICE candidates.
Remarks
Used by both the client and the server peer connection. A STUN entry lets a peer behind a NAT discover its own public address, and a TURN entry relays traffic when no direct path exists — typically a client on a network that blocks UDP. Accepts a comma-separated list ofstun:/turn: URLs, or a JSON array of
RTCIceServer objects. Use the JSON form for TURN: credentials must be
given as separate username/credential fields, since they cannot be
embedded in the URL. Invalid values are rejected at startup rather than
failing on the first client connection.
Default
Example
Inherited from
NetworkConfig.ICE_SERVERS
LISTENING_INTERFACE
LISTENING_INTERFACE: string
Defined in: modules/network/src/server/config.server.network.ts:42
Network interface address the server binds to.
Default
LISTENING_TCP_PORT?
Defined in: modules/network/src/server/config.server.network.ts:21 Port on which the TCP WebSocket server listens.optionalLISTENING_TCP_PORT?:string
Remarks
Either this orLISTENING_UDP_PORT (or both) must be set.
LISTENING_UDP_PORT?
Defined in: modules/network/src/server/config.server.network.ts:32 Port on which the UDP (WebRTC signaling) WebSocket server listens.optionalLISTENING_UDP_PORT?:string
Remarks
Either this orLISTENING_TCP_PORT (or both) must be set.
NETWORK_MODE
NETWORK_MODE:Defined in: modules/network/src/shared/config.network.ts:78"dedicated"|"p2p"
p2p when the game’s nanoforge.config.ts sets network: "p2p": the
server app runs in the host player’s browser. Set by the nf CLI.
Default
Inherited from
NetworkConfig.NETWORK_MODE
WSS_CERT?
Defined in: modules/network/src/server/config.server.network.ts:53 Path to the TLS certificate file for WSS support.optionalWSS_CERT?:string
Remarks
Must be set together withWSS_KEY.
WSS_KEY?
Defined in: modules/network/src/server/config.server.network.ts:64 Path to the TLS private key file for WSS support.optionalWSS_KEY?:string
Remarks
Must be set together withWSS_CERT.