A little more than a month ago, Ian Hickson released draft 76 of the WebSocket protocol, which was unusually incompatible with previous drafts. Headers in the client upgrade request grew a Sec-Websocket prefix, and there is now an interesting challenge-response computation that needs to be performed on the headers and body. Caveat Emptor to those who implement draft specifications, I guess!
Thus far, Chrome seems to be the major test browser for WebSockets (though Safari implements them as well), and they switched over to draft 76 a few weeks ago. So the Chrome betas speak draft 75, and the nightlies speak 76.
Fortunately, it’s possible to write WebSocket servers that interoperate seamlessly with both versions, by detecting those new Sec-Websocket headers and doing the appropriate handshake for the appropriate version. Andrew Godwin implemented this logic for Eventlet’s websocket module, so you can use it to serve sockets to any browser that’s out there today. Find it in the development branch, which you can install by running
We’ll be keeping a weather eye on the spec as it proceeds.