-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
socket.io does not work on Firefox 6 beta #377
Comments
So i changed the Content-Type of the handshake response to 'text/plain; charset=UTF-8' and it fixed the syntax error. The connection will still hang after that though. |
Oh wait, I just realized that the client tries to initialize a WebSocket but that this fails with the following error: Error: WebSocket is not a constructor I read up a bit about Firefox 6 and websockets and found this:
(https://developer.mozilla.org/en/WebSockets/Writing_WebSocket_client_applications) If I call new WebSocket in the console of Firefox 6 it gives me the above error. If I call new MozWebSocket I get an error about missing parameters, whuch looks promising. However:
(https://developer.mozilla.org/en/WebSockets) I do not know if socket.io already supports this new protocol version. Maybe socket.io should fall back to XHR/Flash for Firefox 6 in the meantime? |
I tried some stuff like checking in WS.open if MozWebSocket exists and if so generating that instead of WebSocket, but it seems socket.io does not cope with the new WebSocket protocol (the Socket keeps disconnecting). The easiest workaround seems to be checking for MozWebSocket before calling io.connect and if it exists simply call io.connect('host', {transports: ['xhr-polling']}); (you can also check for flash and add it if it is available). This way you circumvent the Firefox 6 problem. |
Firefox 6 uses a different WebSocket specification than the 2 that we support. Firefox 6 still in beta so there might still be changes in the code base that affect us. Also see bug #232 |
According to the comments on https://bugzilla.mozilla.org/show_bug.cgi?id=664692 a fix for this should land soon in Aurora. Keeping this open until we can confirm that the bug has been fixed inside firefox. |
Firefox 6 is now released, and Bug 664692 mentioned above has been resolved fixed in FF6. |
Have just installed the release version of FF6. Socket.io is now falling back to using XHR. I see the following response in Firebug before XHR is used Returns: XML Parsing Error: syntax error Location: moz-nullprincipal:{412755d3-4777-b341-9828-7a05293049a8} Line Number 1, Column 1: What gives? WebSockets were working perfectly for me in FF5. I'm using the latest version of socket.io (0.7.9). Anyone else seeing this? |
I have the same problem. Socket.io resorts to polling. I noticed that the FF6 final still uses MozWebSocket. Socket.io 0.7.9 is not testing against that. But imo it should, since FF6 is final. When Mozilla decides to implement WebSocket we'll file a bug again ;) This little mod could work: in socket.io.js:
and in websocket.js: WS.check = function () { But it doesn't :( Guess it needs a little extra work... |
You could simply try the following shim (clientside, of course):
|
That would be even simpler indeed. It just doesn't work. Probably MozWebSocket has a slightly different api. On 24Aug, 2011, at 05:25 , steveWang wrote:
|
fireferret |
Morriz: That's because FF6+ uses a different websocket standard, which still isn't supported by Socket.IO. |
yeah.. i've tried that but it doesnt work!!! Sent from my iPhone On 24/08/2011, at 00:27, Morriz
|
did you try fireferret |
It's not going to work, it's a different spec. |
Should be fixed in 0.8 |
No difference for me using Socket.io 0.8.2 and FF 6.0.1 on Mac OS X??? |
@bigal488, I'm also using FF 6.0.1 on OS X and that works quite well. Did you see any error messages in the server logs, or network / console in FireBug? |
@einaros, same as @bigal488, I got the same problem. Here are my info's :
Server log :
Client log :
Hope i didn't miss anything. |
@pyrostrex, can you see which source line it complains about? Alternatively, could you see if my socket.io-client fork fixes the issue? https://github.com/einaros/socket.io-client |
I see exactly the same errors as @pyrostrex
and Firebug reports:
The response headers show only:
|
@bigal488, @pyrostrex, Alright, thanks. I pushed an update to https://github.com/einaros/socket.io. See if that fixes the issue. |
@einaros, that's the problem, the console only complains about the syntax error that was returned by the latest http request but then it's like it doesn't do anything at all after the syntax error. It complains on line 1. everytime will be on line 1. But when i stopped using websocket (enables everything other than websocket). the syntax error is not a problem at all. It just skip through the syntax error and move on to the other request. For chrome, I'm using the latest and of course, Mac OS X Chrome doesn't have any problem. But when I used Windows 7's Chrome, this is where the nightmare comes. The problem lies when the client send the upgrade websocket request. It just hangs. It's like the request was made right before socket.io can finish its interception with the express route "/1/websocket/....". Then, the second problem is, when I enabled all transports including websocket, it will not revert to any other transports after trying to connect to WebSocket transport. Edit: I tried ur fork, the problem is still exist. |
Does this refer to my fork of socket.io-client, or my last post pointing to my socket.io fork? I'd be surprised if the latter doesn't fix this. |
Yes - the combination of your socket.io and socket.io-cleint is working for me too - thanks very much. |
I'm experiencing this issue as well. It also seems to fail in Chrome 15b as well. Sounds like bigal488 got it working but I'm not sure of the steps he/she took to accomplish it. Anyone have a quick writeup on what to do? I'm hosting my Node service at http://no.de if it makes a difference. |
When using socket.io in Firefox 6 beta the connection will hang after performing authorization. The connect event will not be fired on the server. The Firefox debugging console provides the following information:
Error: Syntax-Error
Sourcefile: http://host/socket.io/1/?t=1310553989400
Line: 1, Column: 1
Sourcecode:
190006406397831442:15:25:websocket,htmlfile,xhr-polling,jsonp-polling
Since firefox claims a syntax error maybe a correct mimetype will help (there's none set in the response)?
The text was updated successfully, but these errors were encountered: