Real-time Magic
Experience the power of Soli's built-in WebSocket support.
Scalable, resilient, and easy to use.
ID: ...
S
System
Welcome to the WebSocket demo! Try sending a message.
1 Define the Route
config/routes.soli
router_websocket("/ws/chat", "websocket#chat_handler");
2 Handle Events
app/controllers/websocket_controller.soli
fn chat_handler(event) {
if event["type"] == "message" {
// Broadcast to all clients
return { "broadcast": event["message"] };
}
}