Re: [hybi] Multiplexing in WebSocket

Ian Hickson <ian@hixie.ch> Fri, 23 October 2009 03:43 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 4E0A63A68DF for <hybi@core3.amsl.com>; Thu, 22 Oct 2009 20:43:40 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.457
X-Spam-Level:
X-Spam-Status: No, score=-3.457 tagged_above=-999 required=5 tests=[AWL=1.142, BAYES_00=-2.599, GB_I_INVITATION=-2]
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 nLLep1IcCkTo for <hybi@core3.amsl.com>; Thu, 22 Oct 2009 20:43:39 -0700 (PDT)
Received: from looneymail-a1.g.dreamhost.com (caibbdcaaaaf.dreamhost.com [208.113.200.5]) by core3.amsl.com (Postfix) with ESMTP id 1C0013A68DE for <hybi@ietf.org>; Thu, 22 Oct 2009 20:43:39 -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 B057A15D570; Thu, 22 Oct 2009 20:43:48 -0700 (PDT)
Date: Fri, 23 Oct 2009 03:57:03 +0000
From: Ian Hickson <ian@hixie.ch>
To: Greg Wilkins <gregw@webtide.com>
In-Reply-To: <4AE08907.7080402@webtide.com>
Message-ID: <Pine.LNX.4.62.0910230348470.9145@hixie.dreamhostps.com>
References: <4ACE50A2.5070404@ericsson.com> <3a880e2c0910081600v3607665dp193f6df499706810@mail.gmail.com> <4ACF4055.6080302@ericsson.com> <Pine.LNX.4.62.0910092116010.21884@hixie.dreamhostps.com> <4AD2E353.8070609@webtide.com> <4AD2F43D.6030202@ninebynine.org> <4AD39A64.4080405@webtide.com> <Pine.LNX.4.62.0910132335390.25383@hixie.dreamhostps.com> <4AD53DCA.6050304@webtide.com> <Pine.LNX.4.62.0910170203460.9145@hixie.dreamhostps.com> <4ADA7FD4.9010406@webtide.com> <4ADB6F0B.4000004@gmail.com> <Pine.LNX.4.62.0910221120380.9145@hixie.dreamhostps.com> <4AE08907.7080402@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] Multiplexing in WebSocket
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: Fri, 23 Oct 2009 03:43:40 -0000

On Thu, 22 Oct 2009, Greg Wilkins wrote:
> Ian Hickson wrote:
> > Having a simple protocol doesn't preclude this.
> > 
> > Having a complex protocol requires it.
> 
> I think this is a straw man.  Any protocol that is not websocket is not 
> by definition complex.

I didn't mean to imply that, my apologies.


> Something like BWTP could also be written over a weekend in perl or 
> similar.  It could also run in the many little server mode that you 
> think is best.
> 
> The hard part of "monolithic" servers is not implementing the protocol.  
> It is implementing as scalable protocol, an application environment, all 
> the goop specified by JEE specs (if you are in java), the security 
> sandbox, etc
> 
> If you don't want all that, then even HTTP can be built in a day or two 
> - I've done so several times.

I am skeptical that a _fully conforming_ HTTP server can be implemented in 
a weekend by most Web devs.


> > On Sat, 17 Oct 2009, Greg Wilkins wrote:
> >> Ian Hickson wrote:
> >>
> >>> Then the author really should just combine the event sources into one 
> >>> (or use the EventSource feature
> >> But there might not be 1 author!  Mash-ups and portals and such things 
> >> will combine the work of many authors unknowingly onto the same page. We 
> >> want to encourage reuse of components and not require every webapp to be 
> >> rewritten from scratch with a shared messaging infrastructure.
> > 
> > I don't buy that these widgets will all be communicating with the same 
> > backend.
> 
> Why not?  if they are all on a portal page put together by www.bigCompany.com
> then they all might be accessing the services of bigCompany.com

Then they could just use a common JS library that multiplexed for them. 
Why would www.bigCompany.com open multiple connections to itself, if it 
wanted to save on the number of TCP connections to its servers?


> Currently companies put static content onto common CDN services, and 
> maybe in future there will be dynamic services on common services.
> 
> I've already seen social networking services, advertising services and 
> analytic services having common components on many many websites, so it 
> is increasingly likely that multiple unrelated pages from different 
> sites will access common services on common hosts.

Sure; but then they would almost certainly also want common resources 
locally, and could therefore just use a common shared worker with a single 
TCP connection.


> > If the widgets are from third parties, then they wouldn't all talk 
> > back to the same server.
> 
> Not if the widgets are all different ways of presenting the data/events 
> from the same server.

I do not believe this is the 80% case, and thus do not think it is worth 
addressing in the first version.


> > I disagree with your pessimism here. I think there is ample evidence 
> > that people are happy to use JS libraries to talk to services. 
> > Consider Google's GData API. Do you know anyone who uses this API 
> > without using the GData JS library?
> 
> If there was a performance advantage to be gained, then I'm sure they 
> would.  But with XHR based APIs, coding to the GData API or to XHR gives 
> you the same access to the underlying network resources.
> 
> If there was an API in the browser that gave me a dedicated HTTP 
> connection, I would certainly use it now for long polling - even though 
> I know that rationally that is not the best thing to do.

I think authors are lazier than that, personally.


> > The IETF is welcome to do whatever it likes. The only reason Web 
> > Sockets is here is that the IETF wanted it here.
> 
> And since you have accepted the IETFs invitation to submit a draft, you 
> should do so in good faith and not expect the IETF to rubber stamp what 
> you've done simply because you have no intention of changing it.

I've made lots of changes to the WebSocket protocol -- heck, I've made so 
many changes based on feedback here and elsewhere that people have started 
complaining that I've made too many!

There is a difference between not making any changes, and not making the 
changes you want me to make. I do not believe that multiplexing is a good 
idea in this protocol.


> Remember, it is not just the browser vendors that websocket must win 
> over.  In order for it to be a success, then all kinds of web 
> infrastructure needs to be updated to support it - firewalls, proxies, 
> web caches, corporate policies etc. etc.

Actually, as designed, WebSocket does an end-run around most of these. The 
only case I'm aware of where WebSocket would need help is in environments 
that do not even allow port 443 traffic to pass through unmolested.


> You can open a real socket from a web browser now with commonly
> installed plugins - but it is not that useful because the network
> community does not allow arbitrary sockets to traverse the network.

Actually commonly installed plugins have security models to prevent 
arbitrary port connections, just like WebSockets. Personally I think the 
WebSocket security model is better than, say, Flash's, but at the end of 
the day it has much the same effect and provides much the same feature. 
The difference between Flash and WebSocket is the same as between Flash 
and HTML5 <video>: one is proprietary, the other is vendor-neutral.

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