Testing the Browser Support

To test if the browser supports Web Sockets, use the following feature-detect for the WebSocket API.

var websockets_support = !!window.WebSocket;
Related Tutorial