Subject: [hybi] Dispatch an error event when no handshake response is received?

From: Takeshi Yoshino <[email-masked]>
Date: Wed, 30 Oct 2013 19:52:47 +0900

I think it makes sense to _fail_ when the underlying connection is opened
successfully but is closed by the server before the client receives a
handshake response.

But it's not explicitly specified in RFC 6455.

Maybe we can refer to this text to handle the case by _fail_.

> If the server's response does not conform to the requirements for the
> server's handshake as defined in this section and in Section 4.2.2,
> the client MUST _Fail the WebSocket Connection_.

Any concern?

---

From: Joakim Erdfelt <[email-masked]>
Date: Wed, 30 Oct 2013 07:22:49 -0700

Since this is about the API, the section you pasted has a number of
pre-existing failure examples that I would think you have cases for already.
Just mimic the behavior of those existing errors.

Currently, in Chrome and Firefox, those situations don't report, via
javascript, the details of _why_ it failed, just that it failed.
The Chrome javascript console, however, does log some additional detail on
the error condition.

Some test cases that the jetty project uses.

Client request with Sec-WebSocket-Protocol, server response with none.
Client request without Connection header.
Client request with multi-value Connection header (aka: "Connection,
keep-alive")
Client request without Sec-WebSocket-Accept header.
Client request with bad Sec-WebSocket-Accept header.
Server response without Sec-WebSocket-Accept header.
Server response with bad Sec-WebSocket-Accept header.
Server response with Sec-WebSocket-Extension token not present on Client
handshake request.
Server response with Sec-WebSocket-Extension configuration that client
cannot handle.
Client request without Upgrade header.
Client request with bad Upgrade header.
Server response without Upgrade header.
Server response with bad Upgrade header.
Server response to upgrade that is not 101 Switching Protocols (such as
200, or 403)

With the possible exception of the 403 response to upgrade, the rest are
error conditions that should be reported to the users of the client API.
I say just use whatever you currently have.

--
Joakim Erdfelt <[email-masked]>
webtide.com <http://www.webtide.com/> - intalio.com/jetty
Expert advice, services and support from from the Jetty & CometD experts
eclipse.org/jetty - cometd.org

On Wed, Oct 30, 2013 at 3:52 AM, Takeshi Yoshino <[email-masked]>wrote:

> _______________________________________________
> hybi mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/hybi
>
>