Subject: [hybi] How to select which websocket protocol to use

From: Francis Brosnan Blazquez <[email-masked]>
Date: Tue, 22 Dec 2009 15:37:51 +0100

Hi,

In the case someone wants to use BWTP, how is this signaled to the
Websocket (javascript) API? Is this controlled by the "protocol"
constructor argument?

Cheers!
-- 
Francis Brosnan Blazquez <[email-masked]>
ASPL

---

From: Greg Wilkins <[email-masked]>
Date: Wed, 23 Dec 2009 11:35:58 +1100

> Websocket (javascript) API? Is this controlled by the "protocol"

I believe that is the intent.

However, for this to work well, I think there needs to be several
other "systems" put in place.

To avoid protocol name clashes, either they will need to be allocated
by IANA or something already unique like URLs will need to be used.

I would also like to see that the usage of the frame-type bytes
be scoped by protocol name.   So that if a protocol like BWTP
wants to define a set of frametypes (for header frames vs
body frames etc.), then it can do so with out clashing with
other uses of those bytes.    This would also avoid the need
for IANA to allocated additional values for this byte.

cheers

---

From: Thomas Broyer <[email-masked]>
Date: Wed, 23 Dec 2009 09:53:59 +0100

On Tue, Dec 22, 2009 at 3:37 PM, Francis Brosnan Blazquez wrote:
> Websocket (javascript) API?

IIUC, BWTP and Websocket are not really comparable, and the Websocket
API is only designed to work with the Websocket protocol (BWTP
supports metadata in every "message" for instance, which the Websocket
API wouldn't expose).

> Is this controlled by the "protocol" constructor argument?

This argument will populate the "subprotocol name" of the Websocket
handshake, it's not meant to switch to BWTP or other bidirectional
protocols.

-- 
Thomas Broyer
/tɔ.ma.bʁwa.je/

---

From: Francis Brosnan Blazquez <[email-masked]>
Date: Thu, 24 Dec 2009 11:37:15 +0100

Hi,

> I'm not a big fan for exposing more detail in the API, because
> that just exposes transport details to the application.

Current WebSocket javascript API is perfect assuming it provides a TCP
connection (or close to)...however it seems there is no consensus on
WebSocket protocol design.

BWTP has the advantage that works over existing HTTP infrastructure
(specially HTTP proxy) and its framing design is more secure (length
limited) and consistent (only one) but it provides lot of features that
makes it too heavy for the purpose (implement something similar to
TCP). 

..and WebSocket has the advantage that fits better the purpose but has a
problem with existing infrastructure and a framing style which could
provide binary support but at the end, how is this signaled from
javascript API? Clearly UTF-8 based framing is flagged as default in the
draft.

Ian, I think when IANA proposed WebSocket to use 80 and 443 port, maybe
they were also saying to accomodate the WebSocket protocol to be
friendly with existing HTTP infrastructure. What do you think?

In the other hand, there is a general consensus that an octet and length
limited framing is more robust, secure and general (you can transmit
both UTF-8 or arbitrary binary content). Why don't change this to have a
single framing style?

Cheers!