Re: [hybi] WebSockets

Ian Hickson <> Tue, 31 March 2009 02:11 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id E9A6A3A6AE7 for <>; Mon, 30 Mar 2009 19:11:16 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -2.222
X-Spam-Status: No, score=-2.222 tagged_above=-999 required=5 tests=[AWL=-0.223, BAYES_00=-2.599, J_CHICKENPOX_65=0.6]
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id GYM11fLr7BJE for <>; Mon, 30 Mar 2009 19:11:16 -0700 (PDT)
Received: from ( []) by (Postfix) with ESMTP id 3AAF23A6A89 for <>; Mon, 30 Mar 2009 19:11:16 -0700 (PDT)
Received: from ( []) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTP id 5A6FB122544; Mon, 30 Mar 2009 19:12:13 -0700 (PDT)
Date: Tue, 31 Mar 2009 02:12:13 +0000
From: Ian Hickson <>
To: "Roy T. Fielding" <>
In-Reply-To: <>
Message-ID: <>
References: <> <>
Content-Language: en-GB-hixie
Content-Style-Type: text/css
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset="US-ASCII"
Subject: Re: [hybi] WebSockets
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Server-Initiated HTTP <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Tue, 31 Mar 2009 02:11:17 -0000

On Mon, 30 Mar 2009, Roy T. Fielding wrote:
> It would be nice to have a list of use cases for why anyone would want a 
> Web page (as opposed to an installed client or client extension) to 
> provide two-way communication,

Some sample use cases:

 * GMail's built-in IM client
 * Collaborative editing as seen in tools like Google Apps
 * Multiplayer games
 * Pages that monitor services, e.g. a wifi router's status page, showing 
   up-to-date information about signal:noise ratios, etc.

Personally the reason I want a WebSocket-like mechanism is so that I can 
make my Web-based model railway control panel quicker. Right now every 
time I click anything it has to do a round-trip TCP connection to the Web 
server to tell it to tell the computer running the trains to perform the 
action, whereas what I really want is for the Web page to just have a 
direct connection to that computer. This would also allow the train 
controlling computer to give immediate feedback instead of having to 
tunnel messages back through a long-lived CGI script returning drip-fed 
<script> blocks to an <iframe> over a long-lived HTTP connection.

> and also why that two-way communication must be tunneled over the Web 
> ports in a way that deliberately intends to fool security-enforcing 
> intermediaries into thinking it is HTTP.

For my use case (the trains) I'm fine with not doing any tunneling, 
however it turns out that a lot of sites block all but port 80 and port 
443 and yet people still want to use their IM clients. Right now Web 
applications like GMail are tunneling through ports 80 and 443 by abusing 
HTTP; I think it would be much better to have them Upgrade to another 
protocol and leave HTTP for REST-like purposes.

Note that the way WebSocket is designed, there's no deliberate fooling; 
it's a straight up HTTP Upgrade attempt.

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