cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Support of the Web Socket protocol - API

From: Alexandre Morgaut <alexandre.morgaut_at_4d.com>
Date: Tue, 4 May 2010 13:43:12 +0200

On 4 mai 2010, at 01:24, Jamie Lokier wrote:

> Seems like a good idea.
>
> It probably makes sense for libcurl to behave a little like it does
> with telnet, because both are bidirectional streams, but WebSocket
> transmits UTF-8 string messages as the basic unit, delimited by 0xff
> bytes, rather than telnet's byte stream.

Well the telnet implementation is just an example ;-)

IETF still shows the draft 75 as the more recent one:
https://datatracker.ietf.org/doc/draft-hixie-thewebsocketprotocol/

But sure that if the draft 76 breaks compatibility and people are working to implement it, it should be the one to look after...
http://www.whatwg.org/specs/web-socket-protocol/

If WebSocket can transmits UTF-8 String delimited by 0xff,
     ; the wire protocol as allowed by this specification
     frames = *frame
     frame = text-frame / closing-frame
     text-frame = %x00 *( UTF8-char ) %xFF
     closing-frame = %xFF %x00
There is a description of future support for binary frames
A length is then specified before each frame (really looks like HTTP chunk)
     ; the wire protocol including error-handling and forward-compatible parsing rules
     frames = *frame
     frame = text-frame / binary-frame
     text-frame = (%x00-7F) *(%x00-FE) %xFF
     binary-frame = (%x80-FF) length < as many bytes as given by the length >
     length = *(%x80-FF) (%x00-7F)
That was the reason for my use case with a camera resource.
The problem is just that this support appears to be not yet officially ready

IMHO :

The first requirement would be to support the initial handshake, text frames, and the closing frame
The second would be to support cookies
The third would be a first support of binary frames (Implementors don't wait for a stable draft, the draft is made stable from implementation feedbacks ;-) )

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-05-04