Skip to main content

Module ws

Module ws 

Source
Expand description

WebSocket hub for real-time event streaming.

Provides a /api/ws endpoint that streams server events to dashboard clients via a tokio::sync::broadcast channel.

Supports two authentication methods:

  • Query parameter: ?token=<api_token> (Tauri/API clients)
  • Session cookie: tuitbot_session=<token> (web/LAN clients)

Structs§

AccountWsEvent
Wrapper that tags every WsEvent with the originating account.
WsQuery
Query parameters for WebSocket authentication.

Enums§

WsEvent
Events pushed to WebSocket clients.

Functions§

ws_handler
GET /api/ws — WebSocket upgrade with token or cookie auth.