Hacker News new | past | comments | ask | show | jobs | submit login

Current story on WebSockets

There are two components to web sockets. The WebSocket API under development by the W3C/HTML5 groups (http://dev.w3.org/html5/websockets/) which defines the javascript/browser API and the WebSocket Protocol under development by the HyBi working group at the IETF (http://datatracker.ietf.org/wg/hybi/charter/) which defines the actual wire protocol.

The WebSocket API has been relatively stable for awhile, most of the changes recently have been hashing out how to handle binary messages in javascript.

The WebSocket wire protocol has been undergoing more substantial development in the past year and is presently in the Last Call phase of IETF standardization. The final wire protocol has not been fixed yet.

Protocol version numbers were added sometime last year and each version stands for which draft version of the protocol the user agent is implementing. Not all drafts change the wire protocol so some version numbers aren't used. The purpose of the version numbers was to help folks who were writing test implementations of websocket to keep track of which implementations should work together for interoperability testing.

The draft/version number primarily indicates that the client can only talk to servers that speak the same version. Clients typically support only one draft, servers often support multiple drafts. The current draft (http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketproto...) uses protocol version 13. FireFox 6 ships with a prefixed (MozWebSocket) websocket object that implements draft 7. FireFox 7 and 8 and Chrome 14 and 15 (beta and dev channels respectively) currently implement draft 8, though this may change before they are shipped. Safari 5.0.1+ and Chrome 7-13 implement draft 0, an obsolete version from 2010.

Draft 7,8, and 13 are nearly identical, a server supporting one will likely support all three. Draft 0 is significantly different. There is a list on wikipedia of the major websocket implementations and which protocol versions they presently support (http://en.wikipedia.org/wiki/Comparison_of_WebSocket_impleme...).

The OP appears to be using a simplified version of a pre-draft 0 that Pusher implemented. I am not actually sure why it is using websocket at all since it doesn't appear to actually use the browser as the source of the connection. It just happens to be using an early draft of the websocket protocol as it's message framing mechanism.




Thanks for taking the time to write up the details. I appreciate it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: