Closed motmot80 closed 10 years ago
It seems like #175 covers a similar subject.
I believe with the synchronous API, server can inject pretty much anything after the handshake. Take a look at https://github.com/cesanta/mongoose/blob/master/examples/websocket.c#L25.
Hi,
if a websocket client requests a subprotocol (Sec-WebSocket-Protocol) the server should return the subprotocol to the client. RFC 6455 4.2.2 5,6 . I think it's only optional if the client does NOT request a subprotocol.
Chrome > 29 handles this strictly and denies any websocket connection with subprotocol not responded/recognized by the server:
"WebSocket connection to 'ws://server' failed: Error during WebSocket handshake: Sec-WebSocket-Protocol mismatch"
I fixed this by simply adding the "Sec-WebSocket-Protocol" with the client subprotocol - if there's any. (dirty stuff : )
There should be an callback or something to react on a client subprotocol request.
Thanks for your great work.
Best regards, Thomas