You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
client sends Sec-WebSocket-Protocol header with protocol list (separated by ',')
server responds with one protocol from this list
WebSocket client compares request header (protocol list) with response header (one protocol) value and fails with the error Protocol was not set in the opening handshake
letws=newWebSocket('ws://server...',['msgpack','json'])ws.addEventListener('error',e=>console.log(e.error))// server choses json and responds with `Sec-WebSocket-Protocol: json`// client failed
Expected Behavior
Correct subprotocol check
Environment
Node.js v21.6.2
--experimental-websocket flag
The text was updated successfully, but these errors were encountered:
The client can request that the server use a specific subprotocol by
including the |Sec-WebSocket-Protocol| field in its handshake. If it
is specified, the server needs to include the same field and one of
the selected subprotocol values in its response for the connection to
be established.
Bug Description
Sec-WebSocket-Protocol
header with protocol list (separated by ',')Protocol was not set in the opening handshake
undici/lib/web/websocket/connection.js
Line 179 in c49058b
Reproducible By
Expected Behavior
Correct subprotocol check
Environment
--experimental-websocket
flagThe text was updated successfully, but these errors were encountered: