Re: [hybi] Proposal: HTTP upgrade process

Vladimir Katardjiev <vladimir@d2dx.com> Tue, 17 August 2010 10:18 UTC

Return-Path: <vladimir@d2dx.com>
X-Original-To: hybi@core3.amsl.com
Delivered-To: hybi@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 624023A68DB for <hybi@core3.amsl.com>; Tue, 17 Aug 2010 03:18:30 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.599
X-Spam-Level:
X-Spam-Status: No, score=-2.599 tagged_above=-999 required=5 tests=[BAYES_00=-2.599]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 26hpBMe0h+tY for <hybi@core3.amsl.com>; Tue, 17 Aug 2010 03:18:29 -0700 (PDT)
Received: from homiemail-a2.g.dreamhost.com (caiajhbdcaid.dreamhost.com [208.97.132.83]) by core3.amsl.com (Postfix) with ESMTP id 2DB333A6877 for <hybi@ietf.org>; Tue, 17 Aug 2010 03:18:29 -0700 (PDT)
Received: from homiemail-a2.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a2.g.dreamhost.com (Postfix) with ESMTP id 5E167280070; Tue, 17 Aug 2010 03:19:04 -0700 (PDT)
DomainKey-Signature: a=rsa-sha1; c=nofws; d=d2dx.com; h=subject:mime-version :content-type:from:in-reply-to:date:cc:message-id:references:to; q=dns; s=d2dx.com; b=a2aPnaxeiT87+mBZlxOPy+zihvxHgXxfepBVjm3z5Y r010xIlg31UPoYV78tpKF5shc/1X3GDCsb3Bequ6asC5TNBImRfMl2d1AshOPNiK 3Qkhj0k5QTbmCg0xRr52ucPTrBhXLe/efOljpYYCja0VFRrv4yavSwiSA04g5Nj1 Y=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=d2dx.com; h=subject :mime-version:content-type:from:in-reply-to:date:cc:message-id :references:to; s=d2dx.com; bh=1vi8xRUnuh3qRFpLFMjYJt1rS1M=; b=p S1sSzEtoB5zpHmKc33CEQMB/qr74yoy1lsIcWF02sm8xClreOLfWBIO5+XThR9hs loLyCFRTs9kS4U53c50ZlJLy13GzIehAaXIq2XRtC1XxtQ2xJoII82HD7NcGOOpE PvrJq9GzLlEX990Kgf/Osh1M8BwZ/7ip8OUwrRkE7Q=
Received: from dhcp118.verkstad.net (dhcp118.verkstad.net [192.36.157.118]) (Authenticated sender: vladimir@d2dx.com) by homiemail-a2.g.dreamhost.com (Postfix) with ESMTPA id 32D40280062; Tue, 17 Aug 2010 03:19:02 -0700 (PDT)
Mime-Version: 1.0 (Apple Message framework v1078)
Content-Type: multipart/signed; boundary="Apple-Mail-28-937944519"; protocol="application/pkcs7-signature"; micalg="sha1"
From: Vladimir Katardjiev <vladimir@d2dx.com>
X-Priority: 3 (Normal)
In-Reply-To: <e2c63402e7f2b66428df3948498d6e45.squirrel@sm.webmail.pair.com>
Date: Tue, 17 Aug 2010 12:18:58 +0200
Message-Id: <6EDF9BD6-DD74-4598-A4DB-1E635132ACB1@d2dx.com>
References: <AANLkTi=aR8+LgcoXDVhuu-HC2k3TB6YP2WcXEo8yC1Jz@mail.gmail.com> <903054FE-EEFB-46A6-A008-9EBE71EB873A@d2dx.com> <e2c63402e7f2b66428df3948498d6e45.squirrel@sm.webmail.pair.com>
To: shelby@coolpage.com
X-Mailer: Apple Mail (2.1078)
Cc: Hybi <hybi@ietf.org>
Subject: Re: [hybi] Proposal: HTTP upgrade process
X-BeenThere: hybi@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Server-Initiated HTTP <hybi.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/hybi>, <mailto:hybi-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/hybi>
List-Post: <mailto:hybi@ietf.org>
List-Help: <mailto:hybi-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/hybi>, <mailto:hybi-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 17 Aug 2010 10:18:30 -0000

Hm. It seems I accidentally sent out the wrong version of the mail. I didn't intend to sound as if I was arguing for the eight bytes themselves. What I thought I wrote in addition was that the intention was for the 8 bytes to be functionally part of the WS stream, so figure this:

1) HTTP Upgrade request
2) 101 response
3) 8 bytes random req
4) WS OK response

Since this would be 2 RTTs (1-2 + 3-4), in -76, 1&3 and 2&4 were baked into each-other. I don't necessarily agree with that; I'd prefer separation of concerns, but I was mainly intending to explain why those eight bytes found their way into the text in the first place.

Vladimir

On 17 aug 2010, at 11.07, Shelby Moore wrote:

> [snip]
> 
>> That's (relatively) easy. From Ian's omnibus WebSocket Feedback mail on
>> April 15:
>> 
>>>> If the handshake messages are to contain content, then they MUST have
>>>> headers to indicate the content length to be legal HTTP: in this case,
>>>> a
>>>> Content-Length header would be appropriate
>>> 
>>> The idea here is that the 8 random bytes are part of the post-Upgrade
>>> Web
>>> Socket connection, not the GET request, so that any intermediaries will
>>> fail to send the data along if they do any interpretation, thus failing
>>> early. If we included them in the Content-Length then unfortunately the
>>> early failure mode of intermediaries would be lost.
>> 
>> If memory serves, it was also used for checking if the server programmer
>> is also capable of following instructions and generating hashes, a notion
>> that might not be required if the working assumption is no longer that
>> every script implements its own WebSocket stack. This would leave the main
>> reason for those eight bytes a sort of "fail-early" test, so that a
>> WebSocket connection will terminate before the "open" event has been fired
>> in the browser. This is considered preferable to firing the "open" event
>> after a successful handshake, but then losing the connection because,
>> oops, after all it was an incompatible intermediary.
> 
> 
> But then forcing every proxy in the universe to be upgraded with a
> specific code path every time someone else uses HTTP Upgrade to create a
> new protocol with "early fail" hack:
> 
> http://www.ietf.org/mail-archive/web/hybi/current/msg03203.html
> 
> If not failing after WebSocket "open" event is a high priority, then
> "officially" (admittedly imperfect and flexible process) declared
> concensus was we need to find another transport option, rather than hack
> the HTTP spec.
> 
> Maybe this is off-topic for this thread is I think about "process", not
> the details of the technical debate.
> 
> [snip]