Re: [hybi] Extensibility mechanisms?

Ian Hickson <ian@hixie.ch> Mon, 19 April 2010 00:06 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 053183A68B7 for <hybi@core3.amsl.com>; Sun, 18 Apr 2010 17:06:00 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.445
X-Spam-Level:
X-Spam-Status: No, score=-0.445 tagged_above=-999 required=5 tests=[AWL=-0.761, BAYES_50=0.001, SARE_MILLIONSOF=0.315]
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 Ei3JxIMKWNFj for <hybi@core3.amsl.com>; Sun, 18 Apr 2010 17:05:58 -0700 (PDT)
Received: from looneymail-a2.g.dreamhost.com (caibbdcaaaaf.dreamhost.com [208.113.200.5]) by core3.amsl.com (Postfix) with ESMTP id 40D9B3A6830 for <hybi@ietf.org>; Sun, 18 Apr 2010 17:05:58 -0700 (PDT)
Received: from ps20323.dreamhostps.com (ps20323.dreamhost.com [69.163.222.251]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by looneymail-a2.g.dreamhost.com (Postfix) with ESMTP id 7EDEE16D403; Sun, 18 Apr 2010 17:05:50 -0700 (PDT)
Date: Mon, 19 Apr 2010 00:05:50 +0000
From: Ian Hickson <ian@hixie.ch>
To: Scott Ferguson <ferg@caucho.com>
In-Reply-To: <4BCB7829.9010204@caucho.com>
Message-ID: <Pine.LNX.4.64.1004182349240.751@ps20323.dreamhostps.com>
References: <h2w5c902b9e1004152345j992b815bz5f8d38f06a19181a@mail.gmail.com> <Pine.LNX.4.64.1004160701250.751@ps20323.dreamhostps.com> <4BC860FD.8080007@webtide.com> <Pine.LNX.4.64.1004161952530.751@ps20323.dreamhostps.com> <4BC96A0D.4080904@webtide.com> <Pine.LNX.4.64.1004180246380.751@ps20323.dreamhostps.com> <4BCAB2C1.2000404@webtide.com> <B9DC25B0-CD21-44E7-BD9B-06D0C9440933@apple.com> <4BCB7829.9010204@caucho.com>
Content-Language: en-GB-hixie
Content-Style-Type: text/css
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset="US-ASCII"
Cc: Hybi <hybi@ietf.org>
Subject: Re: [hybi] Extensibility mechanisms?
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: Mon, 19 Apr 2010 00:06:00 -0000

On Sun, 18 Apr 2010, Scott Ferguson wrote:
> 
> The client and server APIs must be suitable for amateur programmers, and 
> the wire protocol must support those simple APIs, but it's _not_ 
> important that the wire protocol be implementable by someone who can't 
> understand buffering, chunking or encoding. After all, HTTP/1.1 requires 
> those capabilities.

IMHO, HTTP is a disaster in terms of getting multiple server-side 
implementations. Over three quarters of the market is dominated by two 
vendors, and the third largest vendor on a per-server basis is a company 
that runs a proprietary implementation and derives significant benefit 
from being able to do so. There are some custom servers, e.g. in some set 
top boxes or other network devices too small to run one of the few common 
servers, and many of those are highly incomplete or buggy implementations.

I would not consider HTTP a model solution here. On the contrary. Its 
complexity has led to a rather stagnant monoculture which is an attacker's 
dream. A single exploit can affect millions of servers.


> The "long tail" in HTTP is enabled by the server APIs: CGI, mod_xxx, PHP,
> Servlets, ASP, etc, and the client javascript API. It is indeed very important
> that the server-side and client-side APIs for WebSockets be usable by hobbyist
> programmers to do simple things.
> 
> However, the "long tail" are not writing hobbyist HTTP client or server
> protocol implementations.

That's because HTTP is too complicated. If we make Web Socket simple 
enough on the server that it's just as easy to roll your own Web Socket 
server as to use an HTTP framework today, then I see no reason why the 
long tail shouldn't write hobbyists Web Socket servers.


> In addition, WebSockets is intrinsically multithreaded, which makes the 
> claim that it's aimed at amateur implementers bizarre.

It's relatiely straight-forward to implement Web Sockets using a select(3) 
loop, no need for threads.


> WebSockets requires threading/async handling on both ends, which is 
> beyond the capabilities of these hypothetical amateur programmers who 
> cannot encode a simple frame.

The difference is that writing a select(3) loop is something you can learn 
from tutorials then implement with trial and error, and without which your 
server will not work at all; while getting text length encodings right 
requires asking questions that many ASCII-only authors will never know to 
even ask. (This is less of a problem in locales where non-ASCII characters 
are common, of course, at least for authors who use this feature to 
transmit natural language text.)

Actually measuring lengths is relatively straightforward in most languages 
once you know you have to do it.

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