Features
- Raw WebSocket handlers: Use
onWebsocketfor low-level WebSocket control and custom protocols - Real-time cursor tracking: Broadcast cursor positions to all connected users instantly
- Persistent canvas state: Text labels automatically saved in actor state across sessions
- Multiple rooms: Each room is a separate actor instance with isolated state
Implementation
This example demonstrates low-level WebSocket handling for real-time collaboration:
- Actor Definition (
src/backend/registry.ts): Uses rawonWebsockethandler for custom WebSocket protocol implementation
Resources
Read more about WebSockets, state, and events.



