(Presentation at the Dutch Django/web meeting)
Websockets give you a persistent TCP connection between a browser and your server, which is handy if you want to exchange data between the two of them continuously.
How it works? The client makes an initial handshake request which is then used to set up a real connection. The protocol of the handshake is upgraded from time to time, so you have to make sure your service stays up to date with the latest browsers.
The good thing about a socket connection is that there’s very low latency: you don’t lose time with setting up an http connection all the time and you don’t have headers. And... serializing json is easy. But you can also transfer binary data.
For Python support for websockets look at TxWebsocket (based on twisted, Jeroen prefers this). There is also “Autobahn WS”, which is commercial. And there’s “gevent-websocket”. All browsers support it, basically, but for IE you need the upcoming IE10. There’s a Flash fallback, though, if you need it.
He showed a demo of two browser windows next to each other where you could see the changes made in the one in the other.
Some challenges: find a useable pluggable reference CMS. Cleanup the design and architecture. Proper documentation! And they want to build a community around it. Another big challenge: google can’t open the socket connection and download the content: now it only grabs the empty startpage.
My name is Reinout van Rees and I work a lot with Python (programming language) and Django (website framework). I live in The Netherlands and I'm happily married to Annie van Rees-Kooiman.
Most of my website content is in my weblog. You can keep up to date by subscribing to the automatic feeds (for instance with Google reader):