-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
Subprotocol support #17
Comments
I assume you are interested in support for selecting a subprotocol during handshake? That is doable, what I'm probably not going to add here is implementations for actual subprotocols. |
Yeah, just selecting a subprotocol. Chrome fails to connect if the handshake reply doesn't contain the subprotocols sent in the |
Okay, I'll look into it. |
@ziad-floosi I think this should do it. To test, install simple-websocket directly from the main branch of this repository. When using Flask-Sock, you can pass the list of subprotocols accepted by the server in the If the client requests a subprotocol or a list of them, the server will find the first subprotocol that it knows about and include it in the acceptance message. In the server, you can get the selected protocol inside the websocket route with |
Works perfectly, thank you so much for the quick fix. There seems to be some log message that prints out the subprotocol list when the WS server receives a request. Not super important, but just wanted to let you know. https://github.com/miguelgrinberg/simple-websocket/blob/main/src/simple_websocket/ws.py#L339-L340 |
Released as simple-websocket 0.8.0. 🎉 |
Are there any plans for subprotocol support in this library?
The text was updated successfully, but these errors were encountered: