I'm not sure if the spec is clear on this but the example shown in https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Sec-WebSocket-Protocol seems to show a space after the comma.
e.g. Sec-WebSocket-Protocol: soap, wamp
But websockify does not seem to handle this in protocols = headers.get('Sec-WebSocket-Protocol', '').split(',') and will produce a list of protocols that looks like ['soap', ' wamp'] in this case.
I noticed this in emscripten when trying to switch from the ws npm module to node's builtin WebSocket client: emscripten-core/emscripten#26682.
It seems like the builtin node WebSocket client will always produce this list with a space after each comma.
I'm not sure if the spec is clear on this but the example shown in https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Sec-WebSocket-Protocol seems to show a space after the comma.
e.g.
Sec-WebSocket-Protocol: soap, wampBut websockify does not seem to handle this in
protocols = headers.get('Sec-WebSocket-Protocol', '').split(',')and will produce a list of protocols that looks like['soap', ' wamp']in this case.I noticed this in emscripten when trying to switch from the
wsnpm module to node's builtin WebSocket client: emscripten-core/emscripten#26682.It seems like the builtin node WebSocket client will always produce this list with a space after each comma.