Closed spoorn closed 1 week ago
We could set the Sec-Websocket-Protocol
and it could improve the compatbility with other engine.io clients. But it would be set to "engine.io" as it is the only sub protocol used with websocket. There is no way that the user would be able to manually set it because it would not respect the ws protocol spec.
If you want to support subprotocols over socket.io you can use the auth payload or query params.
Is your feature request related to a problem? Please describe.
Support
Sec-Websocket-Protocol
header in websocket handshake so the server can define subprotocols it accepts. Some info on the header fieldDescribe the solution you'd like
I'm not sure if it's expected to support this outside of
socketioxide/engineioxide
, such as directly viaaxum
, but it seems socketioxide does the websocket upgrade in ws.rs and the response to the client should contain the subprotocol accepted by the server.SEC_WEBSOCKET_ACCEPT
is already there.I would imagine a user would have some way to configure for the websocket server connections (e.g. subprotocols to support) when creating the SocketIO layer