Raw WebSocket Handler

Raw WebSocket Handler

Demonstrates raw WebSocket handling with direct actor connections and real-time chat functionality.

Features

  • Raw WebSocket handlers: Use onWebSocket for low-level WebSocket control and custom protocols
  • Direct actor connections: Connect WebSocket clients directly to actor instances
  • Connection management: Track WebSocket connections with state and broadcasting
  • Real-time chat: Message broadcasting with user presence and chat history
  • Persistent state: Messages and user data automatically saved in actor state

Implementation

This example demonstrates raw WebSocket handling for real-time chat:

Resources

Read more about WebSockets, state, and events.