I'm running Firefox 7 in Ubuntu 11.04, and I noticed socket.io was falling back from web sockets to xhr-polling, so I typed WebSocket
in Firefox's console, and got
[00:48:21.224] ReferenceError: WebSocket is not defined
On Google Chrome 14 I got
WebSocket
function WebSocket() { [native code] }
According to this, WebSockets is partly supported since firefox 4 and fully supported since firefox 6.
Is it only different in firefox on linux ?
In Firefox 4/5, WebSockets support is present but disabled (activated via about:config). In Firefox 6, Mozilla enabled WebSockets by default but added the "Moz" prefix. Also, note that Firefox 6 uses the newer HyBi protocol and W3C API. Chrome added the HyBi protocol in Chrome 14 although Chrome has never used a prefix.
The protocol is effectively complete and the official first version is expected to be published in about 6 weeks (the wire format has not changed significantly in months). The API has also been quite stable for months and Chrome 14+ and Firefox 6+ basically have the same implementation of the API. For some reason Mozilla has chosen to be even more cautious than normal with WebSockets prefixing. Perhaps it is a reaction to Google not being careful enough about prefixing unstable APIs.
Unless you are interested in binary message support, specific error and close condition handling or sub-protocol selection, then the WebSockets API has been essentially the same since Chrome introduced it a couple of years ago. If you are implementing a WebSockets server then you will need to know about the various versions of the protocol which has seen significant changes in the past 2 years.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With