Re: [hybi] WS port with BOSH-like fallback?

Jamie Lokier <jamie@shareable.org> Wed, 01 December 2010 10:58 UTC

Return-Path: <jamie@shareable.org>
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 EDB053A6CC5 for <hybi@core3.amsl.com>; Wed, 1 Dec 2010 02:58:28 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.266
X-Spam-Level:
X-Spam-Status: No, score=-3.266 tagged_above=-999 required=5 tests=[AWL=-0.667, 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 fiHM+MHlXVLc for <hybi@core3.amsl.com>; Wed, 1 Dec 2010 02:58:28 -0800 (PST)
Received: from mail2.shareable.org (mail2.shareable.org [80.68.89.115]) by core3.amsl.com (Postfix) with ESMTP id 1A7D73A6CC4 for <hybi@ietf.org>; Wed, 1 Dec 2010 02:58:28 -0800 (PST)
Received: from jamie by mail2.shareable.org with local (Exim 4.63) (envelope-from <jamie@shareable.org>) id 1PNkPT-0002qz-8m; Wed, 01 Dec 2010 10:59:39 +0000
Date: Wed, 01 Dec 2010 10:59:39 +0000
From: Jamie Lokier <jamie@shareable.org>
To: "Alakkad, Achuth (GE Healthcare)" <Achuth.Alakkad@ge.com>
Message-ID: <20101201105939.GK22787@shareable.org>
References: <AANLkTi=UpWdjqU0Lkh11wSGtHVDO71_CvjWJyH4mPyQi@mail.gmail.com> <4590EC7E9324CF43A2B37F81AFD6357007BB59B9@BANMLVEM07.e2k.ad.ge.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <4590EC7E9324CF43A2B37F81AFD6357007BB59B9@BANMLVEM07.e2k.ad.ge.com>
User-Agent: Mutt/1.5.13 (2006-08-11)
Cc: Hybi <hybi@ietf.org>, Greg Wilkins <gregw@intalio.com>
Subject: Re: [hybi] WS port with BOSH-like fallback?
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: Wed, 01 Dec 2010 10:58:29 -0000

Alakkad, Achuth (GE Healthcare) wrote:
> 
>    To me the main advantage of websocket is that, it makes use of
>    exisiting accepted port (80). Thus not affecting any intermediatory
>    devices, such as firewal configuration. If we are going to go with an
>    independent port for websockets, then will it start of a monotonous
>    rework for those devices ( like firewall, proxy etc..).

I think Greg's idea is that if the other port fails, then it will use
BOSH-like over port 80, which is real HTTP tunnelling the data, so
your WebSocket application will work fine over firewalls and proxies.

All the current WebSocket schemes break on port 80 for a signficant
fraction of users, so it's not like the port 80 problem is solved yet.

The only problem I see with Greg's idea is how long to wait after
trying the other port, before deciding that it isn't working.  Latency
is poor.

Maybe the solution is to maintain a destination cache in the client,
use BOSH-like over port 80 immediately for destinations not known or
where previously it was needed, and attempt the other port for a few
seconds first when the destination cache says it worked before.  In
all cases, where port 80 is used, attempt the other port as well *in
parallel*, and transfer control to it if it succeeds in connecting.

Sounds a bit complicated, but browser and server implementors can
surely handle it.

Application writers won't care about the workings - they'll just use a
WebSocket object which magically works - and it'll work in all places
where BOSH-like works at the moment.

By the way, that's currently possible in Javascript in some current
browsers, using WebSocket to another port in parallel with BOSH-like
HTTP using XHR, and wrapping it up in a "MyWebSocket" object.

-- Jamie