Re: [hybi] WebSocket subprotocol parameters

Julian Reschke <julian.reschke@gmx.de> Fri, 17 January 2014 11:10 UTC

Return-Path: <julian.reschke@gmx.de>
X-Original-To: hybi@ietfa.amsl.com
Delivered-To: hybi@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 76EA01ADFE2 for <hybi@ietfa.amsl.com>; Fri, 17 Jan 2014 03:10:58 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LB3KR_bgGSet for <hybi@ietfa.amsl.com>; Fri, 17 Jan 2014 03:10:56 -0800 (PST)
Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by ietfa.amsl.com (Postfix) with ESMTP id 79E271ADFC6 for <hybi@ietf.org>; Fri, 17 Jan 2014 03:10:56 -0800 (PST)
Received: from [192.168.1.102] ([217.91.35.233]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0LyR1G-1VJcYw3YMo-015q8D for <hybi@ietf.org>; Fri, 17 Jan 2014 12:10:43 +0100
Message-ID: <52D90F99.6080205@gmx.de>
Date: Fri, 17 Jan 2014 12:10:17 +0100
From: Julian Reschke <julian.reschke@gmx.de>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0
MIME-Version: 1.0
To: Tobias Oberstein <tobias.oberstein@tavendo.de>, "hybi@ietf.org" <hybi@ietf.org>
References: <634914A010D0B943A035D226786325D4446BF9948F@EXVMBX020-12.exch020.serverdata.net>
In-Reply-To: <634914A010D0B943A035D226786325D4446BF9948F@EXVMBX020-12.exch020.serverdata.net>
Content-Type: text/plain; charset="ISO-8859-1"; format="flowed"
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K0:5bqMjh/D/5Rlg3hSfxYte8Z7ca4G5NSHShQQllzhj+8j5ZOH6fC k702OJEG72FNVDq5KmTeISUXhJh089aWn5ZlfImlrLhSS/bwvrY/hsdMPpv3FE3UChJfVI+ CTs8LQR6oz93NUhHdv2Mh93pOgZEijfDuoR627aVyhzbNvZW3cImUJt6bYV4uPwc08tf+Oz 3pCMQV+9tCVIYw6G7zlGg==
Subject: Re: [hybi] WebSocket subprotocol parameters
X-BeenThere: hybi@ietf.org
X-Mailman-Version: 2.1.15
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: Fri, 17 Jan 2014 11:10:58 -0000

On 2014-01-17 10:24, Tobias Oberstein wrote:
> The "Sec-WebSocket-Extensions" allows for parameters for each element, eg (from "permessage-deflate"):
>
> Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits; server_max_window_bits=10, permessage-deflate; client_max_window_bits
>
> Similar seems to be disallowed for _subprotocols_.
>
> RFC6455 says:
>
> """
> The elements that comprise this value
> MUST be non-empty strings with characters in the range U+0021 to
> U+007E not including separator characters as defined in
> [RFC2616] and MUST all be unique strings.  The ABNF for the
> value of this header field is 1#token, where the definitions of
> constructs and rules are as given in [RFC2616].
> """
>
> and RFC2616 says:
>
> """
>         token          = 1*<any CHAR except CTLs or separators>
>         separators     = "(" | ")" | "<" | ">" | "@"
>                        | "," | ";" | ":" | "\" | <">
>                        | "/" | "[" | "]" | "?" | "="
>                        | "{" | "}" | SP | HAT
> """
>
> So
>
> Sec-WebSocket-Protocol: wamp; version=2; serialization=msgpack; batched, wamp; version=1
>
> is disallowed, right?
>
> This is unfortunate, since "simulating parameters" like
>
> Sec-WebSocket-Protocol: wamp.2.msgpack.batched, wamp
>
> is a hack, and more so, RFC6455 requires that all subprotocol name be registered via the " WebSocket Subprotocol Name Registry".
>
> This would mean registering all subprotocol variants:
>
> wamp
> wamp.2.json
> wamp.2.msgpack
> wamp.2.json.batched
> wamp.2.msgpack.batched
> ..
>
> Was there any good reason disallowing parameters for "Sec-WebSocket-Protocol"?

I think that was discussed and the decision was made on purpose. For 
details you'll have to visit the mailing list archives though.

> If not, could this be fixed via errata for RFC6455?

Um, no. This is not a bug but a change request (with the potential of 
breaking existing code).

Best regards, Julian