Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><strong>Answer</strong>: It's not too new and you can use now on almost every browser.</p> <p>WebKit has had WebSockets support for quite a while (basically anybody using <strong>Safari</strong> or <strong>Chrome</strong> has it). Starting with <strong>iOS 4.2</strong> WebSockets have been turned on (Apple had left it de-activated in previous versions). <strong>Opera 11.0</strong> will have it (10.7 is now 11.0). <strong>Firefox 4.0</strong> has it included but disabled by default (enabled in about:config). <strong>Firefox 5.0 or 6.0</strong> will likely have it on by default.</p> <p>For other browsers you can use <a href="http://github.com/gimite/web-socket-js">web-socket-js</a> which is a Flash based fallback. It works well and it's easy to do automatic fallback. It is slower than native WebSockets but still has far lower latency then AJAX/COMET.</p> <p>If Javascript is a valid option for the backend then you might consider using <a href="http://nodejs.org">Node</a> and the <a href="http://socket.io/">Socket.IO</a> library for Node. Socket.IO is mainly a server-side library that supports WebSockets (it incorporates the web-socket-js falback) and various AJAX/COMET/long-poll methods. The client side of Socket.IO allows you to use the same API as on the server side (it's very similar to the normal WebSockets API) and it does detection and selects the optimal transport. The AJAX/COMET/long-poll transports are only used if the browser doesn't have native WebSockets and you choose not to use the fallback.</p> <p>Included with noVNC (HTML5 VNC client) is <a href="https://github.com/kanaka/websockify">websockify</a> which is a WebSockets to TCP socket proxy. There are three implementations: C, python and Node. It might be a useful reference for you. noVNC transfers large amounts of data over WebSockets and it is very sensitive to latency. The Flash fallback is definitely less efficient, but it is still has very usable performance. (Disclaimer: I made noVNC)</p> <p><strong>In summary</strong>: the only place WebSockets is not supported right now is browsers without native WebSockets and without Flash (i.e. current iOS and older Android phones).</p> <p>A couple of misc notes:</p> <ul> <li><p>I find <a href="http://caniuse.com">http://caniuse.com</a> to be best resource for HTML5 (and related) browser support information.</p></li> <li><p><a href="https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-browser-Polyfills">HTML5 Cross-browser Polyfills</a> is a very useful (and long) list of shims, fallbacks, and polyfills that add HTML5 features to browsers that don't support them.</p></li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload