Re: [hybi] Proposal: HTTP upgrade process

Vladimir Katardjiev <vladimir@d2dx.com> Tue, 17 August 2010 12:30 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 7FBF33A6952 for <hybi@core3.amsl.com>; Tue, 17 Aug 2010 05:30:18 -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=[AWL=0.000, 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 pqonQQAcobSV for <hybi@core3.amsl.com>; Tue, 17 Aug 2010 05:30:15 -0700 (PDT)
Received: from homiemail-a3.g.dreamhost.com (caiajhbdcagg.dreamhost.com [208.97.132.66]) by core3.amsl.com (Postfix) with ESMTP id E439C3A694E for <hybi@ietf.org>; Tue, 17 Aug 2010 05:30:14 -0700 (PDT)
Received: from homiemail-a3.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a3.g.dreamhost.com (Postfix) with ESMTP id 93A92284071; Tue, 17 Aug 2010 05:30:50 -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=hCPANYqNCpWQhwFXDTVV0PVAcUugClv/rTOleAjFLT ufKUXIHMWH4rBPhV+NDFaXyFm+UT23SHlZ+rLrI+swvWVV4yuEt0piDvRPediZHS A8PvAD+bT8EHkgrwmMfzSEd5nefnzyFowRgRvZjGQUcCXpTqYZQGZJgoxCucfS5+ 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=yweGJ4w0nXKFnxcmZ9WRWqYCqu4=; b=j TrcXKdgkL9LBUxmX43xQ6T1ySIHm8mSRX2tTMDT6388DHNfxxHW7gUzkyE3cX3HX drQ1LIQrkFtRTC8KCxieWuTa7pFQX0cimPAwtZ9lcEFVjAWVyKqaZ6HggNEruuD9 riBUMe7SAIG9EW37fvah/yJexOVJG467I/q7WUmVts=
Received: from dhcp118.verkstad.net (dhcp118.verkstad.net [192.36.157.118]) (Authenticated sender: vladimir@d2dx.com) by homiemail-a3.g.dreamhost.com (Postfix) with ESMTPA id A07F228406A; Tue, 17 Aug 2010 05:30:49 -0700 (PDT)
Mime-Version: 1.0 (Apple Message framework v1078)
Content-Type: multipart/signed; boundary="Apple-Mail-29-945853624"; protocol="application/pkcs7-signature"; micalg="sha1"
From: Vladimir Katardjiev <vladimir@d2dx.com>
In-Reply-To: <20100817111138.GC6166@1wt.eu>
Date: Tue, 17 Aug 2010 14:30:47 +0200
Message-Id: <E28DA827-74A2-496B-AF67-56F72743CED9@d2dx.com>
References: <AANLkTi=aR8+LgcoXDVhuu-HC2k3TB6YP2WcXEo8yC1Jz@mail.gmail.com> <903054FE-EEFB-46A6-A008-9EBE71EB873A@d2dx.com> <e2c63402e7f2b66428df3948498d6e45.squirrel@sm.webmail.pair.com> <6EDF9BD6-DD74-4598-A4DB-1E635132ACB1@d2dx.com> <20100817111138.GC6166@1wt.eu>
To: Willy Tarreau <w@1wt.eu>
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 12:30:19 -0000

On 17 aug 2010, at 13.11, Willy Tarreau wrote:

> On Tue, Aug 17, 2010 at 12:18:58PM +0200, Vladimir Katardjiev wrote:
>> 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
> 
> Yes, that's it. And the 8 bytes random could even be a PING message.
> 
>> Since this would be 2 RTTs (1-2 + 3-4), in -76, 1&3 and 2&4 were baked into each-other.
> 
> no, not necessarily 2 RTTs if the sender sends the 1+3 at the same time,
> then the responder can receive 1, send 2, then receive 3 and send 4.
> 
> Please check the various cases of HTTP vs round trips in my earlier e-mail here :
> 
>   http://www.ietf.org/mail-archive/web/hybi/current/msg03238.html
> 
>> 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.
> 
> It was to ensure that intermediaries were able to forward them. But in my
> opinion, it does not bring that many advantages over sending them as headers.

When it was under discussion, it was quite the opposite actually. The random eight bytes were intended to _break_ intermediaries that didn't follow HTTP Upgrade correctly. That's why there's no point to those bytes if they are sent in a header -- they might as well not be sent at all.

It has to be something that comes where HTTP would expect there to be a "body", otherwise it won't adequately test whether or not the established connection can support websocket messages. At least that was the intention. I still feel that it's a worthwhile goal to ensure that the established connection is usable before we throw it over to the application.

Vladimir