Re: [hybi] Questions and comments on draft-hybi-thewebsocketprotocol-10

"Roy T. Fielding" <> Tue, 19 July 2011 04:49 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 2195821F869D for <>; Mon, 18 Jul 2011 21:49:19 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -106.599
X-Spam-Status: No, score=-106.599 tagged_above=-999 required=5 tests=[AWL=-4.000, BAYES_00=-2.599, USER_IN_WHITELIST=-100]
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id SOwr0QslwE26 for <>; Mon, 18 Jul 2011 21:49:15 -0700 (PDT)
Received: from ( []) by (Postfix) with ESMTP id C7CC021F8698 for <>; Mon, 18 Jul 2011 21:49:14 -0700 (PDT)
Received: from (localhost []) by (Postfix) with ESMTP id 59808674058; Mon, 18 Jul 2011 21:49:14 -0700 (PDT)
DomainKey-Signature: a=rsa-sha1; c=nofws;; h=subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to; q=dns;; b=YyQeg6urdrnRNA+y 68vxEkU0Gkat+qX6miDdS+/4P2OjnjNtrIPx7j+DlJbBa5FEdZjxIFMaDpdAmxUI rcVWShzCJeORK1FD19ZU5uFbuTfYg21Pnws5vpFQCg+NBYyXfHpJwTOM+E2QWx8s m5TuksQqMjjrhqgLzldsbS6aqd0=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed;; h=subject :mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to;; bh=iA8tlR1BbMe0cNA2/kdFl9riEDU=; b=2JFevivwdHBYJbInrEkWuDAxtQtB SR/L9cTwFtGjc8XVJTObNkSx2yBD5e1sIlzWd2CJlCJGmBiQDV2rhVhnIgc4U24A XRN5FaHJD4GTHaY6Vdwnn5nIcnL7DzNd1pGmspHkFB5cZ/8q9sKrwOpwXN8ymljj e9QIZ/YVqYT+i8A=
Received: from [] ( []) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: by (Postfix) with ESMTPSA id 1C222674057; Mon, 18 Jul 2011 21:49:14 -0700 (PDT)
Mime-Version: 1.0 (Apple Message framework v1084)
Content-Type: text/plain; charset=us-ascii
From: "Roy T. Fielding" <>
In-Reply-To: <>
Date: Mon, 18 Jul 2011 21:49:13 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: <>
References: <> <>
To: Greg Wilkins <>
X-Mailer: Apple Mail (2.1084)
Cc: Mark Nottingham <>, " HTTP" <>
Subject: Re: [hybi] Questions and comments on draft-hybi-thewebsocketprotocol-10
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Server-Initiated HTTP <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Tue, 19 Jul 2011 04:49:19 -0000

On Jul 18, 2011, at 12:50 AM, Greg Wilkins wrote:
> On 18 July 2011 17:06, Mark Nottingham <> wrote:
>> 1) I missed the end of the handshake saga; can someone speak to why GET was chosen over, say, OPTIONS? Roy seems to have strong feelings about that (see recent discussion on HTTPbis).
> I think we went with GET because Roy was not able to well communicate
> his concerns.   He's done a better job in the recent thread in
> httpbis, and I now understand that he is concerned about the
> outstanding semantic GET.   However I still don't understand why he
> thinks OPTION is any better, as it still is a request that requires a
> semantic response.   

OPTIONS is a request for the communication options on the connection
for the target resource.  It is not a request of the resource itself;
it is a meta-request to be processed by the handler of that resource.
It should be obvious why completing the WebSocket handshake is a valid
response to that request if the Upgrade succeeds.  In any case, see

to wonder at how I failed to communicate my concerns.

> In either case I think that websockets should be
> free to define an implicit response (eg 204 No Content) is represented
> by a successful handshake.

GET has specific semantics regarding the state of the resource that is
the target of this request.  If you want to use HTTP over the Web's
standard port, then you are subject to HTTP's definitions.  It is not
that difficult for WebSocket to correctly use GET, as Henrik Frystyk Nielsen
just explained on httpbis, if the target resource is meaningful and not
some generic entry point (like those stupid SOAP gateways).

There is no need for an implicit response of "no content" if the result
of making the WS request via HTTP has application-level semantics that
are equivalent to a response to GET after WS takes over the connection.
For example, if the request results in an asynchronous event feed (the
feed named by that URI), joins the user to a running game (named by
that URI), connects the client to the video stream corresponding
to the eyes of a mini robot (named by that URI), etc.  WebSockets
merely needs to state that the client's HTTP request remains
outstanding after the 101 is sent and the WebSockets application is
responsible for handling and responding to that request in accordance
with the semantics of the target resource.

If that's too much to ask, WebSockets is welcome to define its own
unique method, use OPTIONS (and let the framing be the response), or
use a different port and a different protocol for the handshake.