[hybi] WebSocket subprotocol parameters

Tobias Oberstein <tobias.oberstein@tavendo.de> Fri, 17 January 2014 09:25 UTC

Return-Path: <tobias.oberstein@tavendo.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 0C35D1ADDDA for <hybi@ietfa.amsl.com>; Fri, 17 Jan 2014 01:25:04 -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, RCVD_IN_DNSWL_NONE=-0.0001] 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 1nEMOqpMCnbJ for <hybi@ietfa.amsl.com>; Fri, 17 Jan 2014 01:25:02 -0800 (PST)
Received: from EXHUB020-5.exch020.serverdata.net (exhub020-5.exch020.serverdata.net [206.225.164.32]) by ietfa.amsl.com (Postfix) with ESMTP id A3EEB1ADF4F for <hybi@ietf.org>; Fri, 17 Jan 2014 01:25:00 -0800 (PST)
Received: from EXVMBX020-12.exch020.serverdata.net ([169.254.3.11]) by EXHUB020-5.exch020.serverdata.net ([206.225.164.32]) with mapi; Fri, 17 Jan 2014 01:24:48 -0800
From: Tobias Oberstein <tobias.oberstein@tavendo.de>
To: "hybi@ietf.org" <hybi@ietf.org>
Date: Fri, 17 Jan 2014 01:24:45 -0800
Thread-Topic: WebSocket subprotocol parameters
Thread-Index: Ac8TZNT+ZxEt6fFfT4OtNh9SU04iIg==
Message-ID: <634914A010D0B943A035D226786325D4446BF9948F@EXVMBX020-12.exch020.serverdata.net>
Accept-Language: de-DE, en-US
Content-Language: de-DE
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
acceptlanguage: de-DE, en-US
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Subject: [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 09:25:04 -0000

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"?

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

/Tobias