W3C home > Mailing lists > Public > public-html@w3.org > July 2008

RE: websocket HTTP response parsing

From: Justin James <j_james@mindspring.com>
Date: Thu, 3 Jul 2008 12:14:42 -0400
To: "'Ian Hickson'" <ian@hixie.ch>, "'Julian Reschke'" <julian.reschke@gmx.de>
Cc: <public-html@w3.org>
Message-ID: <011d01c8dd27$e6aba210$b402e630$@com>

I have to ask, "why is this needed"? Between this and the URI/URL/IRI flap,
I am suspicious that we don't like having to ask existing standards bodies
to meet our needs, so we just fork their standard, give it a slight twist...
not a good idea at all. My momma always told me, "better to fit your reality
to the existing standard than to invent a new standard."

Actually, I lied, my mother never said that. But she would have. She said
something similar when I complained about what she made for dinner, and it
holds true here too.

J.Ja

-----Original Message-----
From: public-html-request@w3.org [mailto:public-html-request@w3.org] On
Behalf Of Ian Hickson
Sent: Thursday, July 03, 2008 4:56 AM
To: Julian Reschke
Cc: public-html@w3.org
Subject: Re: websocket HTTP response parsing


On Thu, 3 Jul 2008, Julian Reschke wrote:
> > 
> > Read the first 75 bytes from the server. If the connection closes 
> > before 75 bytes are received, or if the first 75 bytes aren't exactly 
> > equal to the following bytes, then fail the Web Socket connection and 
> > abort these steps.
> > 
> > 48 54 54 50 2f 31 2e 31 20 31 30 31 20 53 77 69 74 63 68 69 6e 67 20 
> > 50 72 6f 74 6f 63 6f 6c 73 0d 0a 55 70 67 72 61 64 65 3a 20 57 65 62 
> > 53 6f 63 6b 65 74 0d 0a 43 6f 6e 6e 65 63 74 69 6f 6e 3a 20 55 70 67 
> > 72 61 64 65 0d 0a
> > 
> > The string "HTTP/1.1 101 Switching Protocols", CRLF, the string 
> > "Upgrade: WebSocket", CRLF, the string "Connection: Upgrade", CRLF.
> 
> Besides the obvious spec readability problem (why confuse people with 
> hex dumps?), why does the spec assign any importance of the reason 
> phrase, when RFC2616 clearly says:
> 
> "The Reason-Phrase is intended to give a short textual description of 
> the Status-Code. The Status-Code is intended for use by automata and the 
> Reason-Phrase is intended for the human user." -- 
> <http://greenbytes.de/tech/webdav/rfc2616.html#rfc.section.6.1.1.p.1>

This isn't HTTP. It's WSP (Web Socket Protocol), which while it may 
vaguely look like HTTP in the handshake, really isn't HTTP and shouldn't 
be treated like HTTP.

(The hex blob is partially to emphasise this, and partially to make sure 
people get it exactly right, as it's much harder to get a hex dump wrong 
than a string with spaces in it, which might wrap in unfortunate ways.)

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Thursday, 3 July 2008 16:15:56 UTC

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:38:56 UTC