Re: [hybi] Apples and Orangutans

Ian Hickson <ian@hixie.ch> Sun, 12 April 2009 22:59 UTC

Return-Path: <ian@hixie.ch>
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 A0A983A6C16 for <hybi@core3.amsl.com>; Sun, 12 Apr 2009 15:59:20 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.483
X-Spam-Level:
X-Spam-Status: No, score=-3.483 tagged_above=-999 required=5 tests=[AWL=-0.884, BAYES_00=-2.599]
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 ZIxAUK-AOMvO for <hybi@core3.amsl.com>; Sun, 12 Apr 2009 15:59:19 -0700 (PDT)
Received: from looneymail-a4.g.dreamhost.com (caibbdcaaaaf.dreamhost.com [208.113.200.5]) by core3.amsl.com (Postfix) with ESMTP id B4C9D3A682A for <hybi@ietf.org>; Sun, 12 Apr 2009 15:59:19 -0700 (PDT)
Received: from hixie.dreamhostps.com (hixie.dreamhost.com [208.113.210.27]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by looneymail-a4.g.dreamhost.com (Postfix) with ESMTP id 48448125C37; Sun, 12 Apr 2009 16:00:30 -0700 (PDT)
Date: Sun, 12 Apr 2009 23:00:30 +0000
From: Ian Hickson <ian@hixie.ch>
To: Maciej Stachowiak <mjs@apple.com>
In-Reply-To: <71289452-5A19-48F4-9819-7FD9747EE9CA@apple.com>
Message-ID: <Pine.LNX.4.62.0904122251070.10339@hixie.dreamhostps.com>
References: <49DEF171.4080506@mozilla.com> <A3699591-148C-4795-967A-6CDE23FE75F0@apple.com> <Pine.LNX.4.62.0904122230550.10339@hixie.dreamhostps.com> <71289452-5A19-48F4-9819-7FD9747EE9CA@apple.com>
Content-Language: en-GB-hixie
Content-Style-Type: text/css
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset="US-ASCII"
Cc: hybi@ietf.org
Subject: Re: [hybi] Apples and Orangutans
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: Sun, 12 Apr 2009 22:59:20 -0000

On Sun, 12 Apr 2009, Maciej Stachowiak wrote:
> > 
> > WebSocket includes a path (from the ws:// URL), which is intended to 
> > be analogous to the TCP port number.
> 
> I'm not sure the path is a good choice for identifying the type of 
> service available. HTTP has both a path and a type. The path is sent by 
> the client and identifies the specific resource. The type is sent by the 
> server and directs how the resource is to be interpreted. I do not think 
> we can expect, for example, multiple chat services to use the same path 
> format, but there may be multiple chat services which choose to use the 
> same protocol-by-convention over WebSocket. Right now, there doesn't 
> seem to be a good way to give this information to the client, in the 
> same way that any arbitrary URL can tell the client that its contents 
> are to be interpreted as XML or PDF or plain text.

I don't understand why a 16bit integer solves the problem for TCP, but a 
string doesn't solve the problem for WebSocket. They seem exactly 
equivalent to me -- they identify the target of the connection, and by 
convention, the protocol that that target supports.

Why couldn't we exect multiple chat services to use the same path for 
their chat server, in the same way that multiple chat services written on 
TCP use the same port?

There's also plenty of precedent on the Web of including type information 
in the URL -- so much so, in fact, that some people find the path 
(specifically the "extension" part of the "filename" component of the 
path) more reliable than the explicit Content-Type data. There's also 
"well-known paths" like robots.txt, which, while suboptimal from HTTP's 
point of view, seem like they'd fit in well with WebSocket.

It's not really clear to me how we would expose the information in the API 
if we were to use something other than the path. It's not like most 
authors are going to care, or check to see what the remote end thinks it 
is speaking -- they'll connect to their own servers, or to well-known 
remote third-party servers, and just talk the protocol that that endpoint 
supports. The path is convenient in that we already have it and it seems 
like it's exactly where authors would put the distinction (just as they do 
today on the Web -- content negotiation is used far less than just 
different URLs for different types, after all).

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'