[Twisted-Python] Autobahn WebSockets - Twisted based WS implementation

Tobias Oberstein tobias.oberstein at tavendo.de
Mon Sep 12 13:37:49 EDT 2011


Hello Reza,

the WS protocol has indeed changed alot from hixie-76. There are binary frames, new framing scheme, interspersed control
frames, masking, etc etc.

Currently, it's in the last review phase involving IESG/IAB members, and the WG chairs want to cross the finish line
in November on WS 1.0 final.

Code base size should not be a measure of completeness, of course. With regard to Autobahn WS, I would nevertheless
say it's quite complete, since it includes a WS test suite with >200 test cases that cover a lot of the spec - and passes all.

The tests are quite rigorous, for example I've taken the pains to implement own UTF-8 payload validator, since
the one that comes with Python has outstanding issues related to surrogate pairs.

Also, the test suite is used already with a couple of server frameworks, and it found several bugs both in
Firefox and Chrome. Of course the test suite increases the total code size.

Another area that took time/code is: support for message-based, frame-based and streaming APIs. I expect (hope;)
that the code structuring that was necessary for the latter helps when implementing - a yet to be defined/agreed -
multiplexing scheme over WS. This was also one reason why I didn't base the code on Site, but Protocol directly.

Anyway, it's good to hear that you're planning to take up development again .. choice is good.

Regards,
Tobias


Von: twisted-python-bounces at twistedmatrix.com [mailto:twisted-python-bounces at twistedmatrix.com] Im Auftrag von Reza Lotun
Gesendet: Montag, 12. September 2011 18:10
An: Twisted general discussion
Betreff: Re: [Twisted-Python] Autobahn WebSockets - Twisted based WS implementation

Hi,

On Mon, Sep 12, 2011 at 4:38 PM, Tobias Oberstein <tobias.oberstein at tavendo.de<mailto:tobias.oberstein at tavendo.de>> wrote:
No, it's not. From a cursory look at the code (didn't knew it existed):

That repo on Github is based on a Twisted branch that was nearly ready for inclusion into Twisted. This was back in the day when the websocket protocol seemed on the verge of stabilizing. Obviously this wasn't the case. I came along and added cross version support for the next iteration of the protocol which was then newly supported in Chrome. Then there came the discovery of a cache poising security flaw that was eventually addressed in the latest iteration of the websocket protocol. I haven't yet had time to incorporate it, though I believe there is an open pull request for its support (thanks, to whoever that was).

Outdated WS protocol, probably wasnt complete at any time, based on the Site class.

Depends on what you consider to be "complete" I guess. It had working examples and stayed close to the reference Twisted implementation, which was in the last stages of its code review.

Autobahn WS has complete, current WS support. Code base is roughly 9k LOC.

Completeness shouldn't really be measured by size of code base. I take your point that the latest version of the protocol is indeed supported in Autobahn, which is a good thing of course.

Thanks for Autobahn - it's useful to take a look at. I'll still continue work on txWebsocket, however, with the intention of:

* eventual inclusion into Twisted (meeting Twisted coding standards, MIT license, etc.)
* small, simple code base

Hopefully one day if and when txWebSocket is finally merged we can standardize on one reference implementation (it doesn't have to be txWebsocket of course - it'd be great if the core of Autobahn could be contributed...)

Thanks,
Reza

--
Reza Lotun
mobile: +44 (0)7521 310 763
email:  rlotun at gmail.com<mailto:rlotun at gmail.com>
work:   rlotun at twitter.com<mailto:rlotun at twitter.com>
@rlotun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20110912/64cc6b36/attachment.htm 


More information about the Twisted-Python mailing list