pub async fn ws_handler(
req: HttpRequest,
stream: Payload,
state: Data<AppState>,
) -> Result<HttpResponse>Expand description
WebSocket upgrade handler for /api/ws.
Upgrades the HTTP connection to a WebSocket and handles Haystack
watch operations (watchSub, watchPoll, watchUnsub) over JSON
messages. Each client request may include a reqId field which
is echoed back in the response for correlation.