Issue #009 [Accepted/open] - Add WebSocket support

Posted by trouch

Optimize push


Comment 1

Posted by trouch

depends on issue 40


Comment 2

Posted by andreas.riegg

FYI, After looking at some aspects behing COMET, long polling and Bayeux I would prefer WebSockets as the most future-proof solution. Interestingly there already exists a OpenSource library family that supports some very important environments like Android, jScript and Python.

See e.g. https://autobahn.ws/ which would allow to make Android native apps right away and salso provides a JS library.

Only caveat is that the Python version is relying on Twisted which is not Python 3.0 ready afaik. Assume that CherryPy is.

You should make shure that the official RFC 6455 release of WebSockets is used. Looks like this https://github.com/Lawouach/WebSocket-for-Python is providing a WebSocket implementation for Python that can be used on top CherryPy for Python 2 and 3.

If I understand WebSockets right we still need some additional component that forms the "wire protocol" that is used inside the WebSockets channel. But no standards exist here, so it could just be the REST/JSON API that WebIOPi already implements.

Andreas


Comment 3

Posted by andreas.riegg

Maybe this https://wamp.ws/ is an interesting approach/example for such a wire protocol that is highly compatible with what WebIOPi already does in the sense of JSON usage for "*" requests.

Andreas


Comment 4

Posted by trouch

don't worry about that ;) I think to use websocket with classical long-polling fallback. I will certainly implement the PubSub model on top of everything. I'm thinking about cherrypy with ws4py, but not sure yet. You are right twisted does not support python 3. I don't know wamp.ws, I will check it.


Comment 5

Posted by trouch

Checked wamp.ws, and its pink color remember me something. I may have already seen it in my watch. Well, it implement PubSub as well ;) Now I have to remember why I don't retained it.


Comment 6

Posted by trouch