I\'m trying to use Javascript to detect if a web browser supports websockets, but using only feature-based detection, I\'m getting false positives, so I added a user agent t
This page comes on top in google search.
In year 2016 cutting the mustard for modern WebSockets implementation (no prefixes such as MozWebSocket) would be
MozWebSocket
if ( 'WebSocket' in window && window.WebSocket.CLOSING === 2 ) { // supported }
http://www.w3.org/TR/websockets/#the-websocket-interface