Subject: [hybi] mux as a subprotocol

From: Pavel Rappo <[email-masked]>
Date: Wed, 28 Jan 2015 22:59:03 +0000

Hi,

I wonder what was the rationale behind making a mux as an extension rather than
as a suprotocol? I mean it could have been just:

    Sec-WebSocket-Protocol: websocket13

on the handshake stage. And voila! we would have a "WebSocket over WebSocket".
Not that simple of course :) It would require all this additional work you've
done in the mux extension, but in an "encapsulation fashion" rather than in an
extension one. Benefits? API would become composable and not confusing.
So if you split WebSocket in 3 parts:

    1. handshake
    2. protocol
    3. transport

then you need to change (1) and (3) to apply WebSocket over WebSocket. Instead
of HTTP handshake you provide WebSocket handshake, instead of TCP socket as
transport you provide a WebSocket messages with specified channel id.

I mean unlike PMCEs this extension changes semantics of the messages. Before you
apply mux you send messages, after you apply it you must send messages _with
some additional data_ orthogonal to the message itself. No doubt it's very good
from the byte saving perspective (*), but from the API point of view it's a bit
strange, isn't it? You couldn't just write something like:

    WebSocket.withExtension("mux")

and proceed to use it the same way as without this extension.  Because
effectively it's a different protocol.

P.S. I might misunderstand the idea of the extension or/and missing some crucial
detail.

-Pavel

-------------------------------------------------------------------------------
(*) Actually it needs to be estimated to make sure it's a significant win.

---

From: Pavel Rappo <[email-masked]>
Date: Wed, 28 Jan 2015 23:30:51 +0000

On Wed, Jan 28, 2015 at 11:24 PM, Andy Green <[email-masked]> wrote:
> It's dead Jim

Yes, I've skimmed through this thread [1]. But I believe my question doesn't
rely on whether mux is dead or not :)

-------------------------------------------------------------------------------
[1]: http://www.ietf.org/mail-archive/web/hybi/current/msg10266.html

---

From: Andy Green <[email-masked]>
Date: Thu, 29 Jan 2015 08:31:27 +0800

> rely on whether mux is dead or not :)

Yeah?  I believe your answer might...

-Andy