-
Notifications
You must be signed in to change notification settings - Fork 226
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
Support custom behavior for some handshake error cases #443
Comments
In fact, Tungstenite is able to do this without any changes. The clue is the stream itself. It should be just We could let Tungstenite return the failed stream inside of |
Ahh thank you, I can get your point. It is a good idea to have something like |
It is possible but quite fragile. There is Alternatively you can perform the handshake by using Probably we should add a |
Thank you for your help! I have a new idea to maintain the current API and behavior while also allowing for handling invalid requests. Let me create a pull request to provide more details. |
I found that currently the server side of tungstenite will directly drop the connection when encountering some handshake failures (the
stream
is moved intoaccept()
so it will be dropped when an error occurs).However I have a requirement to return a valid http response when some websocket related headers are missing (such as the connection upgrade header). Currently tungstenite seems unable to do this.
I wonder if some new accept functions can be added to tungstenite to support this?
The text was updated successfully, but these errors were encountered: