TAGS :Viewed: 4 - Published at: a few seconds ago

[ Firefox WebSockets ]

I've read somewhere that the trunk version of Firefox already had a WebSocket implementation. Nevertheless, I've just tried the 3.7a4pre without success. It still gives me the old "WebSocket is not defined" error message. Am I confused with WebWorkers?

Using a flash-based WebSocket implementation is not an option. Please advice.

Answer 1

According to bug 472529 a patch has not yet been applied to trunk.

WebSocket (both the API and the wire protocol) are still in draft, so we're a way off yet.

Using a flash-based WebSocket implementation is not an option.

I'm afraid a fallback (Flash, Java, XMLHttpRequest long-polling etc.) is your only option in Firefox for now. The only browser that currently has native WebSocket is Chrome.

Answer 2

WebSockets has been just landed on Firefox trunk.

Answer 3

WebSockets disabled in Opera and Firefox 4: http://hacks.mozilla.org/2010/12/websockets-disabled-in-firefox-4/

Answer 4

They are called MozWebSockets on Firefox since v4

Check out the Mozilla Websocket Reference

Answer 5

Since Firefox supports WebSockets not strictly to official standards it had prefix "Moz", so you have to check if WebSocket is existing object, if yes use it, if no check MozWebSocket, if yes, then use it. Since Firefox 11, they do support WebSockets without prefix, so it is the same as in Chrome now.