Skip to main content

WebSocket

Shares the server listen address with TCP. Useful when you need to traverse an HTTP proxy, or when only WebSocket is allowed. For TLS, see TLS.

Example

Server:

# orbien-server.toml
listen = "0.0.0.0:9527"

[transport]
tcpMux = true

Client:

# orbien.toml
server = "YOUR_SERVER_IP:9527"

[transport]
protocol = "websocket"
tcpMux = true
heartbeatInterval = -1
wsPath = "/ws"

Client parameters

ParameterRequiredDefaultDescription
transport.protocolYestcpAlways websocket (or ws)
transport.wsPathNo/~!orbienWebSocket HTTP path; must match the server
transport.tcpMuxNotrueTCP multiplexing; must match the server
transport.heartbeatIntervalNo-1Application heartbeat interval (seconds); -1 disables it. Becomes 30 when tcpMux is off
transport.heartbeatTimeoutNo-1Heartbeat timeout (seconds); disconnect if no Pong. Becomes 90 when tcpMux is off; see TCP Multiplexing

Server parameters

ParameterRequiredDefaultDescription
listenYes0.0.0.0:9527Shared listen address with TCP
transport.wsPathNo/~!orbienWebSocket HTTP path; must match the client
transport.tcpMuxNotrueTCP multiplexing; must match the client