WebSocket API Reference
The WebPlatform exposes two WebSocket servers and maintains one outbound WebSocket connection. All messages are JSON-encoded strings.
Ports summary
| Port (default) | Env var | Direction | Purpose |
|---|---|---|---|
8001 | MONITOR_WS_PORT | Frontend ↔ WebPlatform | Admin UI control and state updates |
8080 | HEADSET_WS_PORT | Headset ↔ WebPlatform | Player connection and simulation data |
1000 | GAMA_WS_PORT | WebPlatform → GAMA | GAMA server protocol (outbound client) |
Monitor WebSocket (MONITOR_WS_PORT)
The admin UI (browser frontend) connects to this port. The server broadcasts state updates to all connected monitor clients and sends targeted responses to the requesting client.
Messages: Frontend → WebPlatform
launch_experiment
Start the currently selected simulation in GAMA.
{ "type": "launch_experiment" }
stop_experiment
Stop the running simulation. All headsets are removed from the simulation.
{ "type": "stop_experiment" }
pause_experiment
Pause the running simulation. Headsets stay connected.
{ "type": "pause_experiment" }