I'm currently working with WebSockets and a PHP server: it works very well with Google Chrome and Opera, but not with Firefox 6.
I think it's due to the protocol version this last uses: I see somewhere that it uses the seventh version, whereas it's an older one for Google Chrome and Opera.
So, I modified my server code in order to manage this new version: by hashing the secure-key with 258EAFA5-E914-47DA-95CA-C5AB0DC85B11 and other stuffs, Firefox succeeds to connect. But if another client wants to connect (even another Firefox), the first one with Firefox deconnects itself.
I saw that buffer received by socket_recv() is either empty or hashed...
So I decided to skip the idea of managing the protocol used by Firefox 6 (there are no documentation on Internet... !): I think it could be easier to specify the protocol to use directly in JavaScript.
On this page they say that we can write this:
var mySocket = new WebSocket("http://www.example.com/socketserver", "my-custom-protocol");
But what should we write instead of "my-custom-protocol" in order to use the protocol managed by Google Chrome and Opera?
Thanks in advance!
hybi-00version which is also calledhixie-76and includes the two binary keys. There is also the newhybi-07which uses that secure key you posted. You'd have to generate a correct handshake depending on which version the handshake request is. Since both versions use different header names for the keys, that should be possible.var mySocket = new WebSocket("http://www.example.com/socketserver", "hybi-00");but the header sending by Firefox is still the same... The only difference is now there is Sec-WebSocket-Protocol: hybi-00 in the header, but it still uses the seventh version.hybi-07. You cannot parse them the same way ashybi-00. It does support binary messaging that way though. I once answered another question about this, perhaps it helps: stackoverflow.com/questions/7040078/….