tungstenite-rs icon indicating copy to clipboard operation
tungstenite-rs copied to clipboard

Support custom behavior for some handshake error cases

Open PragmaTwice opened this issue 1 year ago • 4 comments

I found that currently the server side of tungstenite will directly drop the connection when encountering some handshake failures (the stream is moved into accept() 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?

PragmaTwice avatar Sep 06 '24 16:09 PragmaTwice