I am going to develop an instant messaging application that runs in the browser.
What browsers support the WebSocket API?
I am going to develop an instant messaging application that runs in the browser. What browsers support the WebSocket API? |
|||||||||||||||||
|
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.
Client side
Any browser with Flash can support WebSocket using the web-socket-js shim/polyfill. See caniuse for the current status of WebSockets support in desktop and mobile browsers. See the test reports from the WS testsuite included in Autobahn WebSockets for feature/protocol conformance tests. Server sideIt depends on which language you use. In Java/Java EE:
Some other Java implementations:
In C#: In PHP: In Python:
In C: In Node.js:
Vert.x (also known as Node.x) : A node like polyglot implementation running on a Java 7 JVM and based on Netty with :
Pusher.com is a Websocket cloud service accessible through a REST API. DotCloud cloud platform supports Websockets, and Java (Jetty Servlet Container), NodeJS, Python, Ruby, PHP and Perl programming languages. Openshift cloud platform supports websockets, and Java (Jboss, Spring, Tomcat & Vertx), PHP (ZendServer & CodeIgniter), Ruby (ROR), Node.js, Python (Django & Flask) plateforms. For other language implementations, see the Wikipedia article for more information. The RFC for Websockets : RFC6455 |
|||||||||||||||||
|
A good workaround for those browsers that don't yet have native WebSocket support is with this implementation that uses flash to provide WebSocket support to JavaScript: http://github.com/gimite/web-socket-js This allows you to just code to WebSocket, and for browsers that have native support it'll use that. Otherwise it falls back to using flash for the support. |
|||
|
The latest versions of browsers have support for the WebSocket API today. Here are the common browsers that support it:
If you're looking for better legacy support have a look at the "Comet" model. There are frameworks today that make its implementation simpler, such as Nitrogen. Have a look at their chat room example. You may also want to keep an eye on Google App Engine, which with its Channel API (soon available) will support the Comet model with a Web Sockets API interface, meaning that your client-side code won't need to know whether the server is communicating via open HTTP requests or web sockets. You can probably port their interface for use with your own server architecture too. |
|||||||||||||||
|
As of March 2012 from caniuse.com :
|
|||||||
|
Important to know: Websocket support has been DROPPED from both Opera and Firefox 4 in December 2010 due to (general, non-browser specific) security issues: http://hacks.mozilla.org/2010/12/websockets-disabled-in-firefox-4/ It seems the issue does not lie with websockets per se but with other Internet devices that proxy requests, and disabling websockets is just a workaround until the general issue is fixed. Also, it seems the protocol (but not the API) is expected to change, even now e.g. Opera refers to which version of the protocol they actually implement. So even if it were turned on (where it is available at all) it is far from "production ready". This still is an experimental feature. |
||||
js.io implements WebSockets for most browsers, using Orbited. (however, the site is currently down). Using js.io, you can develop your app right now using the WebSocket API. And when browser will implement WebSockets natively, you'll get more performances. |
|||
|
You can also use Hookbox which falls back to long-polling if websocket support is unavailable in the browser. http://bitshaq.com/2010/07/30/a-simple-experiment-with-hookbox/ |
|||
|
It looks like IE 9 RC, Firefox 4 and Opera 11 don't support web sockets. Apparently there is a security issue with it at the moment This article http://hacks.mozilla.org/2010/12/websockets-disabled-in-firefox-4/ seems to be saying that other browsers (chrome and safari) will soon remove web sockets from their features. But you can 'fake' a web socket using silverlight/flash as demonstrated here: http://html5labs.cloudapp.net/WebSockets/ChatDemo/wsdemo.html and https://github.com/gimite/web-socket-js And then just wait for the browsers to catch up. |
|||
|
I'm afraid the only place you're going to find WebSocket support is in the trunk builds of Firefox at the moment. And as far as I know, the work there is still in progress. WebKit browsers (Safari & Chrome, for example) are just getting started on their implementations and they are not even available in the nightly builds. |
|||
|
Jabbers BOSH protocol seems to fit instant messaging very well. Give strophe a try with a server supporting BOSH such as ejabberd. |
|||
|
Opera 11 will support WebSockets based on the 76 draft, one can test it out with the current 10.70 alpha: |
|||
|
This question is protected to prevent "thanks!", "me too!", or spam answers by new users. To answer it, you must have earned at least 10 reputation on this site.