Re: [hybi] Requirement: extensions and sub protocols

Jamie Lokier <jamie@shareable.org> Fri, 05 March 2010 18:50 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 7B44C3A900C for <hybi@core3.amsl.com>; Fri, 5 Mar 2010 10:50:25 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.468
X-Spam-Level:
X-Spam-Status: No, score=-2.468 tagged_above=-999 required=5 tests=[AWL=0.131, 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 JOSyVZjMyh42 for <hybi@core3.amsl.com>; Fri, 5 Mar 2010 10:50:24 -0800 (PST)
Received: from mail2.shareable.org (mail2.shareable.org [80.68.89.115]) by core3.amsl.com (Postfix) with ESMTP id E28923A8DFF for <hybi@ietf.org>; Fri, 5 Mar 2010 10:50:23 -0800 (PST)
Received: from jamie by mail2.shareable.org with local (Exim 4.63) (envelope-from <jamie@shareable.org>) id 1NncbR-0008FH-HC; Fri, 05 Mar 2010 18:50:25 +0000
Date: Fri, 05 Mar 2010 18:50:25 +0000
From: Jamie Lokier <jamie@shareable.org>
To: Greg Wilkins <gregw@webtide.com>
Message-ID: <20100305185025.GB31182@shareable.org>
References: <4B8ECA2D.4050303@ericsson.com> <4B9118DC.6030301@webtide.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <4B9118DC.6030301@webtide.com>
User-Agent: Mutt/1.5.13 (2006-08-11)
Cc: Hybi <hybi@ietf.org>
Subject: Re: [hybi] Requirement: extensions and sub protocols
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, 05 Mar 2010 18:50:25 -0000

Greg Wilkins wrote:
> 
> I think we need to decide who will be doing the extending
> and creating new subprotocols.
> 
> Ian appears to be advancing the position that if it can't
> be done in javascript via the websocket API, then it can't
> be done.  Moreover, that if you are not doing it in javascript
> then you shouldn't be using websockets.
> 
> 
> I disagree with that position (which is hopefully
> somewhat close to what Ian actually is saying).

I'm a bit confused about what Ian's saying in that regard, so I don't
know if it's close or not :-)

But anyway, my position is this:

   - If it *can* be done in Javascript via the API, that's a good thing.
     It means the API is versatile enough.

   - The API isn't relevant to non-browser agents, and constraints
     implied by the API don't affect them.  Only the protocol matters,
     so all constraints affecting the protocol should be written in the
     protocol spec, not inferred from the Javascript API.

Categories:

   1. Some extensions really should remain in Javascript.  There is no
      advantage to complicating the browser for them.

   2. Some extensions are *better* if done by the browser, but it is
      still good to have the ability to fall back to Javascript on an
      older browser.  Multiplexing connections from a single tab/window
      falls into this category.

   3. Some extensions cannot be done from Javascript at all.
      Opportunistically multiplexing connections from all tabs/windows
      to the same destinations (or proxy if there is one) falls into
      this category.  Practically, certain buffering strategies fall
      into this too, but hints from Javascript may be valuable.

It might be good to identify which extensions fall into each category.

Right now, all the extensions involving binary frames and chunking
have no relationship with the Javascript API at all, because it
doesn't support those frames.  It's not clear what the future plan is
for this.  Therefore it's not clear which category they'd fall into.

>   Firewalls acting as aggregators and combining
>   multiple base connections into fewer multiplexed
>   connections to the business servers.
> 
>   Appliances doing SSL offload and converting wss to ws
>   connections with injected certificate information.

These two go well together, by the way.  Fewer connections means fewer
SSL negotiations.

> I also think that there will be extensions done
> in javascript by frameworks/applications, but by
> definition they work above the API and need no more
> support from the base protocol than the API already
> provides.

However, if the base protocol grows some things which help
non-Javascript extensions, such as the chunk no-delay flag we've been
discussing, in some cases it may be useful to expose those
capabilities to Javascript as well.  E.g. I can think of a few games
writable in Javascript which could benefit from that.

-- Jamie