Quick Start
ws://localhost:8000/ws and exchange JSON messages.
Wire Protocol
Client to Server
Server to Client
Heartbeat
The interface sends periodic heartbeat pings. Clients should respond with pong messages to keep the connection alive.Constructor Reference
str
default:"/ws"
WebSocket endpoint path.
bool
default:"false"
Require authentication during the WebSocket handshake.
FastAPI Integration
Usecreate_router() to mount the WebSocket endpoint on an existing FastAPI app: