Open Zydnar opened 2 weeks ago
I tried to define a WebSocket endpoint like this:
server.addWebSocketHandler("pin_handler", std::make_shared<ChatHandler>());
And no matter what I tried, the client in whatever language either freezed at readyState 0 (connection CLOSED) or it couldn't connect - from server side I get Couldn't find WebSocket endpoint for '/pin_handler' However everything's fine when I add /
Couldn't find WebSocket endpoint for '/pin_handler'
/
server.addWebSocketHandler("/pin_handler", std::make_shared<ChatHandler>());
So my suggestion is to check in Server::addWebSocketHandler if edpoint string starts with / and either add it or at least warn about it.
Server::addWebSocketHandler
I tried to define a WebSocket endpoint like this:
And no matter what I tried, the client in whatever language either freezed at readyState 0 (connection CLOSED) or it couldn't connect - from server side I get
Couldn't find WebSocket endpoint for '/pin_handler'
However everything's fine when I add/
So my suggestion is to check in
Server::addWebSocketHandler
if edpoint string starts with/
and either add it or at least warn about it.