Edge Device Communication

WebSocket
Phase 2

Direct browser-to-device communication via WebSocket

WebSocket Architecture

This implementation uses WebSocket for real-time communication with the Rust edge device. No Node.js server required - the dashboard runs entirely in your browser!

Features

  • Direct browser connection
  • Real-time bidirectional streaming
  • Type-safe Zod protocol validation
  • Auto-reconnect with backoff

Connection Details

  • Protocol: WebSocket over HTTP
  • Default endpoint: ws://localhost:3001/ws
  • Message format: JSON with Zod validation
  • Simpler deployment: Single Rust binary

Connection Status

State:
disconnected
URL: ws://localhost:3001/ws

Real-Time Metrics

Live system metrics streamed every 5 seconds

CPU Usage
--
Memory Usage
--
Disk Usage
--

Health Status

Connect to view health status

System Information

Connect to view system information

Audit Log

Recent WebSocket activity (auto-refresh enabled)

No audit log entries yet

Development Mode

To test the WebSocket connection, you'll need to run the Rust edge server on localhost:3001.

Quick Start:

  1. Build the Rust server: cargo build --release
  2. Start the server: cargo run
  3. Click "Connect" in the Connection Status card above
  4. Start streaming metrics to see real-time data

See RUST_WEBSOCKET_SERVER.md for implementation details