MozWebSocket not responding to handshake

1.1k views Asked by At

Firefox 10 do not wont to accept (i realy don't know?) my handshake. Offcorse this is Mozilla then use MozWebSocket insteed of WebSocket. My server response header is:

                $reply = "HTTP/1.1 101 Switching Protocols\r\n" .
                        "Upgrade: websocket\r\n" .
                        "Connection: Upgrade\r\n" .
                        "Sec-WebSocket-Accept: {$accept}\r\n\r\n";

It works under Chrome 16 perfect, but on Firefox it just waiting for something even if servers says than handshake is done. Then after some time offcorse client goes to status 3 (DISCONNECT).

Any ideas?

2

There are 2 answers

0
marverix On BEST ANSWER

I just realized that it is my Firefox (?) fould. I uninstalled FF, deleted whole private data (seriously everything!) and I have installed FF one more time... And the same problem! So I don't know if it is my Windows problem or sth... Never mind... thanks for everything.

1
zaphoyd On

Have you confirmed that you are reading the opening headers correctly and completely? The major difference in websocket handshake processing between Chrome and FireFox right now is that FireFox more fully fills out websocket handshake requests with caching, accept encodings, user agent, etc. In particular double check the "Connection" header, which per the RFC can have multiple values and does on FireFox but not on chrome. The FireFox connection header usually looks like this: "Connection: keep-alive, Upgrade". This can trip up handshake parsers that aren't expecting that header to have multiple values.

Otherwise your handshake response looks correct to me, assuming the $accept value is being calculated correctly, which it sounds like it is if Chrome is accepting it.