Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server::addWebSocketHandler doesn't warn when there is no "/" in the endpoint #203

Open
Zydnar opened this issue Sep 4, 2024 · 0 comments

Comments

@Zydnar
Copy link

Zydnar commented Sep 4, 2024

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 /

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant