According to Wikipedia most browsers use
RFC6455 or a slightly earlier version with an almost identical handshake. The server I'm using only supports
RFC6455 or similar, where it accepts
Sec-WebSocket-Origin: depending on the specified version.
Safari 5 and iOS 5 uses the hixie version of
WebSocket. I normally fall back to long-polling if
WebSocket is missing. Safari 5 has a
WebSocket object, but the handshake is vastly different.
Is there any way to detect if
WebSocket is hixie, or belongs to Safari 5, so I can ignore it without trying the handshake? Are there any ways of checking if the browser is Safari 5 without relying on the user agent?