WebSocket Server Transport
Listens for a WebSocket client, for example a browser page or a device that connects out over WebSocket. Each frame is one message, so no codec is needed: text frames arrive as text messages, binary frames as binary ones, and outgoing binary payloads are sent as binary frames.
Only one client is served at a time; a new client replaces the current one. The Bind Address works as for the
TCP Server: 0.0.0.0 accepts connections from the network, 127.0.0.1 only from this
computer.
Configuration reference
| Config ID | websocket_server_transport |
| Selected by | app_transport = "websocket_server_transport" |
| Platforms | Linux, Windows, Android |
| License | Premium |
WebSocket server accepting single client connection
Listening Configuration:
- Bind Address: Local listening address
0.0.0.0- Listen on all network interfaces, allow any client to connect127.0.0.1- Listen on loopback only, allow only local clients- Specific IP - Listen on specific network interface only
- Bind Port: Port number the server will listen on
Operating Mode:
- Server starts listening on the specified address and port
- Automatically accepts WebSocket handshake requests
- Supports only one client at a time, new connections replace old ones
- Automatically waits for new connections after client disconnects
- Uses standard WebSocket protocol, compatible with all WebSocket clients
| Setting | Key | Type | Default | Notes |
|---|---|---|---|---|
| Bind Address | websocket_server_transport_bind_address | Text | "0.0.0.0" | Required |
| Port | websocket_server_transport_bind_port | Integer | 9001 | Required |
Example config
Default values as they appear in a saved configuration (for example the JSON block at the end of a cycbox/examples/*.lua file). Settings detected at runtime are omitted.
{
"app": {
"app_transport": "websocket_server_transport"
},
"websocket_server_transport": {
"websocket_server_transport_bind_address": "0.0.0.0",
"websocket_server_transport_bind_port": 9001
}
}