/subprotocol/
Either a single value representing the subprotocol the server
is ready to use or null. The value chosen MUST be derived
from the client's handshake, specifically by selecting one of
the values from the |Sec-WebSocket-Protocol| field that the
server is willing to use for this connection (if any). If the
client's handshake did not contain such a header field or if
the server does not agree to any of the client's requested
subprotocols, the only acceptable value is null. The absence
of such a field is equivalent to the null value (meaning that
if the server does not wish to agree to one of the suggested
subprotocols, it MUST NOT send back a |Sec-WebSocket-Protocol|
header field in its response). The empty string is not the
same as the null value for these purposes and is not a legal
value for this field. The ABNF for the value of this header
field is (token), where the definitions of constructs and
rules are as given in RFC2616.
A proper response from the server, when presented with unsupported subprotocol(s) from the client, is to omit the Sec-WebSocket-Protocol or set its value to null, proceed with the upgrade and have the client handle the lack of an agreed subprotocol.
RFC 6455: 4.2.2. Sending the Server's Opening Handshake
A proper response from the server, when presented with unsupported subprotocol(s) from the client, is to omit the
Sec-WebSocket-Protocol
or set its value tonull
, proceed with the upgrade and have the client handle the lack of an agreed subprotocol.This doesn't seem possible currently. The implementation of
HttpResponse.upgrade
requires thesecWebSocketProtocol
argument to be a string like value.Or I maybe missing something? Thanks!