Subject: [hybi] Unsupported websocket subprotocol

From: Per Strandh <[email-masked]>
Date: Sun, 25 Nov 2012 20:23:26 +0100

Hi,

The websocket standard (RFC6455) specifies how a client can specify one or
more subprotocols, and then how the server can select one or none(null) of
them.

If the server selects none of the subprotocols I interpret the standard to
allow the server to upgrade the connection to a websocket.
It would then be possible for the client to use or terminate the connection.

Have I interpret the standard in the correct way on howto a CLIENT
can/should handle an unsupported subprotocol situation?

I also wonder if the SERVER can choose to end the connection (due to
unsupported or required subprotocol)?
If the standard allows it, how should it be done?
- By NOT upgrading the connection and returning some other HTTP response
code than 101?
- By upgrading the connection to a websocket, and then immediately closing
it by sending a 'Close Frame' with some of the predefined websocket Status
codes?
- Some other way?

Regards
/Per/

---

From: Takeshi Yoshino <[email-masked]>
Date: Thu, 29 Nov 2012 16:56:54 +0900

> It would then be possible for the client to use or terminate the
Yes, a browser accepts a client's opening handshake without the
"Sec-WebSocket-Protocol" header (meaning subprotocol=null) even if the
client's opening handshake had the "Sec-WebSocket-Protocol" header.

If the application on the browser doesn't want to keep talking to the
server, it has to close the established connection by itself.

> - By NOT upgrading the connection and returning some other HTTP response

It's not specified. But I think it's ok to reject ones with unsupported
subprotocol list by 400. I don't come up with any issue in WebSocket
protocol layer can be caused by such a rejection.

> it by sending a 'Close Frame' with some of the predefined websocket Status

This is also fine.

> - Some other way?
>
>
> Regards
> /Per/
>
>
> _______________________________________________
> hybi mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/hybi
>
>