Subject: [hybi] Section 5.2.2 clarifications

From: Dirkjan Ochtman <[email-masked]>
Date: Mon, 30 May 2011 14:13:03 +0200

Hi all,

(I'm new here; I hope this is the correct venue for remarks like this.)

I just upgraded from Firefox 5 to Firefox 6 [1], which includes upgrading
from the -76 to the -07 version of the protocol. I found a small
Python server for -76 on the internet, which I've since adapted for
the environment at work, and tried to upgrade the script to -07 from
the spec (since there doesn't seem to be much code out there yet).
Most of the spec seems quite clear, which is great, but I had some
trouble with the server handshake (section 5.2.2).

In particular, it seems like the Upgrade and Connection headers (which
are shown in the example in non-normative section 1.2) should be
mentioned here, as well. Step 3 in this section only mentions the
Status line, the Sec-WebSocket-Accept header and the optional
-Protocol and -Extensions headers. Step 3 starts out to mention that a
"valid HTTP response" is required, and this clearly requires the
Upgrade header in this context (per RFC 2616), but from the RFC I
don't see why the Connection header would be mandatory here. In any
case, it would be nice to expand step 3 a little bit. Including an
example here would also be quite useful (similar to what section 1.2
has for the server part of the handshake). Finally, it might be
sensible to reference the HTTP Status-Line definition again in part 1
of step 3.

And one very minor nit: section 8.2.1 talks about "op codes", whereas
the rest of the document uses "opcode" and "opcodes".

Hope this is helpful,

Dirkjan

[1] I've also just filed
https://bugzilla.mozilla.org/show_bug.cgi?id=660613 against the
Mozilla implementation.