Re: [hybi] extension params (was draft-10 questions)

Greg Wilkins <gregw@intalio.com> Mon, 01 August 2011 04:53 UTC

Return-Path: <gregw@intalio.com>
X-Original-To: hybi@ietfa.amsl.com
Delivered-To: hybi@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 3663721F8569 for <hybi@ietfa.amsl.com>; Sun, 31 Jul 2011 21:53:25 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.888
X-Spam-Level:
X-Spam-Status: No, score=-2.888 tagged_above=-999 required=5 tests=[AWL=0.089, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, RCVD_IN_DNSWL_LOW=-1]
Received: from mail.ietf.org ([64.170.98.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Sr162hv1ay93 for <hybi@ietfa.amsl.com>; Sun, 31 Jul 2011 21:53:24 -0700 (PDT)
Received: from mail-vx0-f172.google.com (mail-vx0-f172.google.com [209.85.220.172]) by ietfa.amsl.com (Postfix) with ESMTP id 82E0521F8574 for <hybi@ietf.org>; Sun, 31 Jul 2011 21:53:24 -0700 (PDT)
Received: by vxi40 with SMTP id 40so5000541vxi.31 for <hybi@ietf.org>; Sun, 31 Jul 2011 21:53:29 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.52.26.236 with SMTP id o12mr3767542vdg.497.1312174409053; Sun, 31 Jul 2011 21:53:29 -0700 (PDT)
Received: by 10.52.114.228 with HTTP; Sun, 31 Jul 2011 21:53:29 -0700 (PDT)
In-Reply-To: <CAMY5452DoLdw_znttJ_quntoGwK8RdTMF3QoE_kU8k81DveLiw@mail.gmail.com>
References: <CAMY5452DoLdw_znttJ_quntoGwK8RdTMF3QoE_kU8k81DveLiw@mail.gmail.com>
Date: Mon, 01 Aug 2011 14:53:29 +1000
Message-ID: <CAH_y2NFVK_MDo8-_D5nj-u-gGXT9wqZ63xaxcYbR4GgM7xksjA@mail.gmail.com>
From: Greg Wilkins <gregw@intalio.com>
To: Brodie Thiesfield <brodie@jellycan.com>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
Cc: hybi@ietf.org
Subject: Re: [hybi] extension params (was draft-10 questions)
X-BeenThere: hybi@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Server-Initiated HTTP <hybi.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/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: Mon, 01 Aug 2011 04:53:25 -0000

Can't this be an instance of being forgiving in what you parse and
strict in what you generate?

We should allow ws servers to use existing HTTP parsers and to accept
quoted strings for any of the header values.
However we could also say that ws clients MUST NOT generate any header
values that need to be quoted.

cheers


On 1 August 2011 10:23, Brodie Thiesfield <brodie@jellycan.com> wrote:
> All,
>
> During the recent IETF meeting the format of the websocket extension
> header parameters was brought up. The issue being should the header
> follow the rules of HTTP (allowing quoted strings) or the simplified
> rules of websocket draft (allowing only tokens).
>
> On Mon, Aug 1, 2011 at 1:02 AM, Patrick McManus <pmcmanus@mozilla.com> wrote:
>> On Sun, 2011-07-31 at 06:13 -0700, Tobias Oberstein wrote:
>>> 2.
>>> In the context of a persistent http connection, what is allowed _before_ the WebSocket handshake
>>> (that is before client sends GET with upgrade header)?
>>
>> prior to the 101 the connection is http. So yes, you can send the
>> bootstrap http request on a reused http connection. You can do anything
>> HTTP allows you to do, because the handshake is carried out over HTTP.
>> That's the point of reusing the infrastructure.
>
> Since a websocket connection is plain HTTP prior to upgrade, then a
> server supporting normal HTTP requests on a connection (i.e. not a WS
> specific server) will already be using its full HTTP parser.
>
> It is not possible to determine what is a WS upgrade message until the
> headers have already been parsed, e.g. the following message is a
> valid upgrade but that is not known until the last byte is parsed.
> Additionally, take away the "Upgrade" header from the end and it is a
> plain HTTP GET with some unnecessary headers.
>
>        GET /chat HTTP/1.1
>        Host: server.example.com
>        Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==
>        Sec-WebSocket-Origin: http://example.com
>        Sec-WebSocket-Protocol: chat, superchat
>        Sec-WebSocket-Version: 8
>        Connection: Upgrade
>        Upgrade: websocket
>
> The WS headers have already been parsed by the HTTP parser. Unless the
> special parsing of the Sec-Websocket-Extension depends solely on the
> header key, there can be no special parsing. If it does depend on the
> header key, then won't this require a change to the HTTP spec to
> introduce the rule that this header key is parsed specially? If it was
> so defined, then every header key of every HTTP message will need to
> be examined to see if it requires the simplified parsing.
>
> If a WS only handshake is ever defined, then all limitations can be
> decided here, but since the current handshake is using HTTP for
> bootstrapping, I don't think that we can specify any format for any
> part of the upgrade message that differs from HTTP.
>
> Of course, a server implementation may not implement a full HTTP
> parser and return a 400 error on quoted string, but for the spec I
> believe that we are bound by their spec until the protocol has been
> switched to WS.
>
>
> Regards,
> Brodie
> _______________________________________________
> hybi mailing list
> hybi@ietf.org
> https://www.ietf.org/mailman/listinfo/hybi
>