socket.io not sending connect message to client on flashsocket

1.3k views Asked by At

I'm using node.js server with socket.io plugin to connect between two clients (flash and js) on different devices

for the flash integration I'm using the FlashSocket.IO library and have io.set('transports', ['websocket', 'flashsocket']); on my .js server file

while everything works fine in most of the computers - on some computers (I don't know if it's relevant but both of the computers that I checked are running Windows 8) - the connection doesn't work

when enabling debug on the server I see that for the working clients the server send 1:: message and for the not-working clients - it doesn't

this is part of the log for working client:

  debug - client authorized
  info  - handshake authorized 8JVqPB6MuJYJeMR3RVN_
  debug - setting request GET /socket.io/1/flashsocket/8JVqPB6MuJYJeMR3RVN_
  debug - set heartbeat interval for client 8JVqPB6MuJYJeMR3RVN_
  debug - client authorized for
  debug - flashsocket writing 1::
  connected - //my console.log call on io.sockets.on('connection', ...
  debug - flashsocket received data packet 5:0+::{"args":"7087623252","name":"register"}

and for the not working client:

  debug - client authorized
  info  - handshake authorized 0nztNzwvw260Pa-bRHef
  debug - setting request GET /socket.io/1/flashsocket/0nztNzwvw260Pa-bRHef
  debug - set heartbeat interval for client 0nztNzwvw260Pa-bRHef
  debug - client authorized for
  connected - //my console.log call on io.sockets.on('connection', ...

p.s.

it doesn't seem like a firewall issue - even when the firewall is off the problem keeps happening

Thank You!

2

There are 2 answers

0
Yaron U. On BEST ANSWER

Eventually it was an antivirus related issue

one second before I got insane I found that the Avast that was installed on that computer blocked the connection - when the Web Shield was disabled - everything worked like a charm

(Installing the same Antivirus on my Win7 machine didn't reproduced the problem - maybe that was Win8+Avast issue)

Thanks anyway

1
user568109 On

I believe it is a browser related issue. From the socket.io github page :

flashsocket will not activate on Chrome or other browsers that fully support WebSockets, even if flashsocket is specified as the only transport. To test flashsocket, use IE 8 or IE 9, or other browsers that don't natively support WebSockets.

So if you want to make sure flashsocket is working correctly use IE 8/9.