Re: [hybi] Web sockets and existing HTTP stacks

Maciej Stachowiak <mjs@apple.com> Wed, 03 February 2010 01:24 UTC

Return-Path: <mjs@apple.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 15C0928C0F0 for <hybi@core3.amsl.com>; Tue, 2 Feb 2010 17:24:50 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -106.345
X-Spam-Level:
X-Spam-Status: No, score=-106.345 tagged_above=-999 required=5 tests=[AWL=0.253, BAYES_00=-2.599, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_MED=-4, USER_IN_WHITELIST=-100]
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 mOwKU7yvkDeK for <hybi@core3.amsl.com>; Tue, 2 Feb 2010 17:24:48 -0800 (PST)
Received: from mail-out3.apple.com (mail-out3.apple.com [17.254.13.22]) by core3.amsl.com (Postfix) with ESMTP id DC14528C0DB for <hybi@ietf.org>; Tue, 2 Feb 2010 17:24:48 -0800 (PST)
Received: from relay15.apple.com (relay15.apple.com [17.128.113.54]) by mail-out3.apple.com (Postfix) with ESMTP id 64621833838E for <hybi@ietf.org>; Tue, 2 Feb 2010 17:25:29 -0800 (PST)
X-AuditID: 11807136-b7bafae000000e8d-4e-4b68d089be25
Received: from elliott.apple.com (elliott.apple.com [17.151.62.13]) by relay15.apple.com (Apple SCV relay) with SMTP id C6.9B.03725.980D86B4; Tue, 2 Feb 2010 17:25:29 -0800 (PST)
MIME-version: 1.0
Content-type: multipart/alternative; boundary="Boundary_(ID_CdJRYaVQ9g7FgUMNjdQK4Q)"
Received: from [17.151.86.222] by elliott.apple.com (Sun Java(tm) System Messaging Server 6.3-7.04 (built Sep 26 2008; 32bit)) with ESMTPSA id <0KX800L0YRYGEJ40@elliott.apple.com> for hybi@ietf.org; Tue, 02 Feb 2010 17:25:29 -0800 (PST)
From: Maciej Stachowiak <mjs@apple.com>
In-reply-to: <ad99d8ce1002012343n132169f8wbaacc1cf4efe2f87@mail.gmail.com>
Date: Tue, 02 Feb 2010 17:25:28 -0800
Message-id: <31123817-6D3F-489D-9F48-109AC93E6769@apple.com>
References: <557ae280911171402v7546e5e7n93a1e57f87dc10e5@mail.gmail.com> <Pine.LNX.4.62.0912032347360.15540@hixie.dreamhostps.com> <4B2C1D52.9020505@webtide.com> <5c902b9e0912181640n497169cdrfa71f9a2908e6ef3@mail.gmail.com> <20091219005442.GA10949@shareable.org> <4B2C287E.1030006@webtide.com> <Pine.LNX.4.64.1001310835410.3846@ps20323.dreamhostps.com> <4B67A237.2040505@webtide.com> <ad99d8ce1002012139l3b8f525bj9caf7861332f3d18@mail.gmail.com> <1427E183-FDBC-4854-9455-B93AB28DAB03@apple.com> <ad99d8ce1002012343n132169f8wbaacc1cf4efe2f87@mail.gmail.com>
To: Roberto Peon <fenix@google.com>
X-Mailer: Apple Mail (2.1077)
X-Brightmail-Tracker: AAAAAQAAAZE=
Cc: hybi@ietf.org
Subject: Re: [hybi] Web sockets and existing HTTP stacks
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: Wed, 03 Feb 2010 01:24:50 -0000

On Feb 1, 2010, at 11:43 PM, Roberto Peon wrote:

> Simple-- the proxy won't know that the response from the server is websocket specific, and may reorder things.
> You should not assume that the termination point (the "host") is a server. It could be a reverse proxy. In such cases, the proxy needs to treat the response as HTTP until it has been fully read and interpreted.
> 
> This response IS HTTP, so HTTP rules apply. It isn't a some random more-restrictive subset of the response rules. It is still HTTP at that point. That means that you don't get to add additional restrictions on that request. If you do, then you're creating headaches for everyone.

OK, just to clarify, are you saying that it's specifically the constraint on header ordering that is a problem? I'm trying to figure out which specific requirements are problematic and why. For example, is the requirement to have some special text in the status line acceptable?

Regards,
Maciej

> 
> Now, I may kick and scream, etc. but I certainly can be convinced that the effort to change is worthwhile if the reasons are not arbitrary.
> What advantage do we get from requiring special behaviors from the servers/proxies in this case? I can't think of any benefits, thus my response!
> 
> -=R
> 
> On Mon, Feb 1, 2010 at 10:11 PM, Maciej Stachowiak <mjs@apple.com> wrote:
> 
> On Feb 1, 2010, at 9:39 PM, Roberto Peon wrote:
> 
>> 
>> 
>> On Mon, Feb 1, 2010 at 7:55 PM, Greg Wilkins <gregw@webtide.com> wrote:
>> Ian Hickson wrote:
>> 
>> > Similarly, the server, when parsing
>> > the headers in "HTTP" mode, is unaffected by the order -- and indeed, the
>> > Web Socket spec doesn't require _anything_ from the server in terms of
>> > parsing the client request. You can completely ignore it for all the spec
>> > cares. All that matters is that you send back a specific handshake. But if
>> > you're sending back the handshake, then you're a Web Socket server, so why
>> > do we need to follow HTTP rules? We've already established the client is a
>> > Web Socket client, so what on earth is the point of using HTTP rules?
>> 
>> We need to follow HTTP rules because we are in a HTTP server
>> that has implemented the HTTP standard and until the CRLF
>> is sent after the 101 response, HTTP rules OK!
>> 
>> Ian-- I know that I'd kick scream and generally raise hell about putting that in our little proxy were it not HTTP compliant until the end of the 101 response.
> 
> The current handshake response *is* HTTP compliant, it's just that the HTTP response needs to meet some additional restrictions, or it will be rejected by the client. Those restrictions include requirements to include particular response headers (apparently not controversial), to include particular text in the status line (only mildly controversial), and to require that the first two response headers headers must be two specific ones, with an exact required order and capitalization (this appears to bug people the most and perhaps creates the most headaches inside existing server code bases).
> 
> Are these restrictions a practical problem for you? If so, which are problematic, and can you describe the concrete issue? Knowing the intensity of your response is less useful than knowing the reason for it.
> 
> Regards,
> Maciej
> 
>