Re: [hybi] How to define the WebSocket protocol (Was: Is there a traffic jam?)

Ian Hickson <ian@hixie.ch> Sat, 06 June 2009 03:37 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 94C8B3A6C6E for <hybi@core3.amsl.com>; Fri, 5 Jun 2009 20:37:21 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -5.56
X-Spam-Level:
X-Spam-Status: No, score=-5.56 tagged_above=-999 required=5 tests=[AWL=-2.961, 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 vGBJZmnRkNBT for <hybi@core3.amsl.com>; Fri, 5 Jun 2009 20:37:20 -0700 (PDT)
Received: from looneymail-a1.g.dreamhost.com (caibbdcaaaaf.dreamhost.com [208.113.200.5]) by core3.amsl.com (Postfix) with ESMTP id 6ED6A3A6BF3 for <hybi@ietf.org>; Fri, 5 Jun 2009 20:37:20 -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-a1.g.dreamhost.com (Postfix) with ESMTP id CC24315D80A; Fri, 5 Jun 2009 20:37:23 -0700 (PDT)
Date: Sat, 06 Jun 2009 03:37:23 +0000
From: Ian Hickson <ian@hixie.ch>
To: Greg Wilkins <gregw@webtide.com>
In-Reply-To: <4A29E18E.1060005@webtide.com>
Message-ID: <Pine.LNX.4.62.0906060328330.16244@hixie.dreamhostps.com>
References: <1cb725390904131712k292a4860pbd078bb251d3855b@mail.gmail.com> <Pine.LNX.4.62.0904140031040.10339@hixie.dreamhostps.com> <1cb725390904131752u5842c039wb3d75602c479fa45@mail.gmail.com> <Pine.LNX.4.62.0904140053050.10339@hixie.dreamhostps.com> <1cb725390904131814o6040a8d3t637069a344d561bd@mail.gmail.com> <Pine.LNX.4.62.0904240546100.10370@hixie.dreamhostps.com> <E51D5B15BFDEFD448F90BDD17D41CFF105AD1ADC@AHQEX1.andrew.com> <Pine.LNX.4.62.0904240805380.12381@hixie.dreamhostps.com> <E51D5B15BFDEFD448F90BDD17D41CFF105AD1E13@AHQEX1.andrew.com> <Pine.LNX.4.62.0904270033570.12381@hixie.dreamhostps.com> <20090427150429.GE4885@shareable.org> <Pine.LNX.4.62.0904271812110.12381@hixie.dreamhostps.com> <49F663DF.7030300@webtide.com> <Pine.LNX.4.62.0906050011290.1648@hixie.dreamhostps.com> <4A29E18E.1060005@webtide.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] How to define the WebSocket protocol (Was: Is there a traffic jam?)
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: Sat, 06 Jun 2009 03:37:21 -0000

On Fri, 5 Jun 2009, Greg Wilkins wrote:
> >>
> >> Also, you have argued against additional frame-type that could better 
> >> support complex behaviour on the grounds that the base frame types 
> >> can carry that complex protocol with assumptions.  If a 
> >> mime-encapsulating frame type is not worth a dedicated frame-type 
> >> byte, then what kinds of extensions do you see additional frame-type 
> >> being defined for?
> > 
> > I've mentioned some before; streaming video and JSON data are two 
> > possible examples. Basically anything that requires API-level changes.
> 
> Why doesn't Mime encapsulated data fit that definition? It would require 
> API changes so that meta data associated with the data could be sent and 
> received?

Because, unlike with, say, video streaming, there's really no need to have 
the browsers support this natively -- it can be layered on top of the 
existing API. One of the core principles I've been following in developing 
HTML5 and other APIs for the Web application platform is to make the core 
platform be as light as possible, supporting just the basics, and then let 
library authors layer on top of this what they need.


> >> More over, the javascript served will probably be from 2, 3 or even 
> >> more distinct sets of developers as frameworks, mashups and other 
> >> such things will bring together the work of many into a single page.
> > 
> > In the more advanced cases, maybe. The more advanced the case, the 
> > more professional the programmers involved, the less the complexity 
> > matters. We have to take into account the non-professional case too, 
> > though.
>
> So why not support optionally richer (but more complex) features that 
> better support these mashups, but are well within the capabilities of 
> these superior programmers?

Because in practice there's no such thing as optional features on the Web. 
We'd end up forcing these features on everyone.


> However, I fundamentally reject the premise that a protocol design 
> should be affected by the quality of programmer who may code it.  What 
> other equivalent protocol (HTTP, FTP, SS7, TCP, etc) has been deliberate 
> made less capable so that amateur programmers may be able to attempt 
> implementations?

I don't think the Internet so far have been particularly successful in 
terms of being used by amateurs. HTML and its APIs is an example of a 
language that _has_ been delibrerately made accessible to amateur 
programmers, with an insane level of success. WebSocket is much more like 
HTML than TCP in this sense.


> I have made several clear proposals, which I do feel have been rejected 
> with little attempt to understand the use-cases that motivate them.

I'm sorry you don't feel that I've made an attempt to understand them; I 
thought I had.


> >> If we wait for non-js-in-browser clients before fully specifying the 
> >> server side of the protocol, then we have a chicken and the egg 
> >> problem.
> > 
> > How so? Could you elaborate on this?
> 
> Because if the protocol does not support non-js-in-browser clients, then 
> they will not be implemented because the the protocol does not support 
> them.  Thus if we wait for them to be implemented before defining the 
> protocol to support them, we will wait forever.

I don't understand why the server side of this protocol is affected by 
whether we get non-JS-in-browser clients.

In any case, as far as I can tell the server side of the protocol _is_ 
fully specified. The server-side requirements aren't identical to the 
client-side requirements, but that's pretty normal. I don't really 
understand the problem here. Servers aren't ever going to receive packets 
they don't recognise in between packets they do; a packet a server doesn't 
recognise is a fatal error. This is unlike clients, who might well exist 
long after the protocol is upgraded, and thus have to be able to deal with 
any number of weird future servers gracefully.

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