WebSocket server + HTTP upgrade handoff (lib split, no std::function)
Goal
Add server-side WebSocket support and integrate it with THttpServer via a clean connection takeover mechanism, while keeping ws optional and avoiding std::function (single virtual dispatch only).
High-level design
- Keep
ws as a standalone library (users of core/http must not link it).
http must be able to hand off an upgraded TCP connection (socket + prefetched bytes) to an external handler without knowing anything about WebSocket.
- HTTP → WS integration is done via a small bridge library.
- Use virtual interfaces (one dispatch point), no type-erasure callbacks.
Library split
coroio_core
coroio_http (generic upgrade/takeover hook, no WS dependency)
coroio_ws (WebSocket protocol + server session)
coroio_http_ws (HTTP<->WS bridge)
Checklist
WebSocket server (ws)
HTTP upgrade / takeover (http)
HTTP<->WS bridge (http_ws)
Testing / validation
Non-goals
- Forcing
ws dependency on core/http users
- Adding multiple layers of dynamic dispatch
WebSocket server + HTTP upgrade handoff (lib split, no std::function)
Goal
Add server-side WebSocket support and integrate it with
THttpServervia a clean connection takeover mechanism, while keepingwsoptional and avoidingstd::function(single virtual dispatch only).High-level design
wsas a standalone library (users of core/http must not link it).httpmust be able to hand off an upgraded TCP connection (socket + prefetched bytes) to an external handler without knowing anything about WebSocket.Library split
coroio_corecoroio_http(generic upgrade/takeover hook, no WS dependency)coroio_ws(WebSocket protocol + server session)coroio_http_ws(HTTP<->WS bridge)Checklist
WebSocket server (ws)
HTTP upgrade / takeover (http)
std::functionin hot pathsHTTP<->WS bridge (http_ws)
Testing / validation
Non-goals
wsdependency on core/http users