MantisBase v0.4.9
Loading...
Searching...
No Matches
ws.h File Reference

WebSocket realtime manager and controller for /api/v1/realtime/ws. More...

#include <chrono>
#include <mutex>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <drogon/WebSocketController.h>
#include <nlohmann/json.hpp>
#include <mantisbase/mantis.h>
#include "realtime_session.h"
Include dependency graph for ws.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  mb::MbWSMgr
 Tracks WebSocket connections, topic indexes, and broadcasts change events. More...
class  mb::MbRealtimeWSController
 Drogon WebSocket controller for the realtime endpoint. More...

Namespaces

namespace  mb

Detailed Description

WebSocket realtime manager and controller for /api/v1/realtime/ws.

Mirrors the SSE two-phase flow:

  • Connect (handleNewConnection): optional auth, welcome { type, client_id, topics: [] }.
  • Subscribe (handleNewMessage): optional token, topic replace, ack with denied[].

Also supports { "type": "auth", "token": "..." } as a token-only upgrade alias.

See also
realtime_session.h
sse.h
realtime.h