| Crates.io | mecha10-nodes-websocket-bridge |
| lib.rs | mecha10-nodes-websocket-bridge |
| version | 0.1.46 |
| created_at | 2025-11-24 19:22:44.42731+00 |
| updated_at | 2026-01-22 17:44:37.919681+00 |
| description | WebSocket bridge node that forwards Redis pub/sub to WebSocket clients |
| homepage | |
| repository | https://github.com/mecha-industries/mecha10 |
| max_upload_size | |
| id | 1948476 |
| size | 103,453 |
Bridges Redis pub/sub messages to WebSocket clients for real-time dashboard communication.
The websocket-bridge supports two operating modes:
Runs a local WebSocket server that dashboards connect to directly. Use this for local development when the dashboard and robot are on the same network.
{
"mode": "server",
"port": 3003
}
Connects outbound to a remote relay service. Use this for production deployments where robots are behind NAT/firewalls.
{
"mode": "client",
"relay": {
"url": "wss://api.mecha.industries/ws-relay",
"robot_id": "${ROBOT_ID}",
"api_key": "${ROBOT_API_KEY}",
"reconnect_interval_ms": 5000,
"heartbeat_interval_ms": 30000
}
}
| Field | Type | Default | Description |
|---|---|---|---|
mode |
string | "server" |
Operating mode: "server" or "client" |
port |
number | 3003 |
WebSocket server port (server mode only) |
relay.url |
string | - | Relay WebSocket URL (client mode, required) |
relay.robot_id |
string | - | Robot identifier for authentication (client mode, required) |
relay.api_key |
string | - | API key for authentication (client mode, required) |
relay.reconnect_interval_ms |
number | 5000 |
Reconnection delay after disconnect |
relay.heartbeat_interval_ms |
number | 30000 |
Heartbeat interval to keep connection alive |
topics.subscribes |
array | [] |
Topics to forward to dashboard |
For client mode, set these on your robot:
export ROBOT_ID="rover-001"
export ROBOT_API_KEY="your-api-key"
Dashboard ──WebSocket──► websocket-bridge ──Redis──► Robot Nodes
Robot Nodes ──Redis──► websocket-bridge ──outbound──► Relay ◄── Dashboard
{"type": "subscribe", "channel": "/sensor/imu"}
{"type": "unsubscribe", "channel": "/sensor/imu"}
{"type": "publish", "channel": "/motor/cmd_vel", "data": {"linear": 0.5, "angular": 0.1}}
{"type": "message", "channel": "/sensor/imu", "data": {...}, "timestamp": 1234567890}