Flash+Node.JS+Socket.io stuck at handshake authorized

I'm writing a small game, socket-based obviously. Everything works fine when in localhost, but when I'm running .swf file from my dedicated server, and trying to connect to node.js server, connection is getting stuck at "handshake authorized":

info: Server starting...
   info  - socket.io started
info: Listening on port 4000
info: Server started.
   debug - client authorized
   info  - handshake authorized _kqPhvoD6jYI-c1Gr7zu

And thats it.

  • Local SWF File -> Local Node.JS -> works.
  • Local SWF File -> Remote Node.JS -> works.
  • Remote SWF File -> Remote Node.js -> doesn't work.

Node version 0.10.12. It's not a firewall or antivirus. Tried running on different ports.

Code example:

//setup express for serving crossdomain on same port as game
var express=require('express');
var app=express();
app.get("/crossdomain.xml", onGetCrossdomain);
var server=require('http').Server(app);

//setup socket io
var socketIo=require('socket.io');
var io=socketIo.listen(server);

//listen on port
server.listen(currentPort);
console.log("Listening on port "+currentPort);

io.set('transports',
[
 'flashsocket'
]);

io.sockets.on('connection', onConnection);


function onGetCrossdomain(req, res)
{
    res.sendfile(__dirname+'/crossdomain.xml');
}

function onConnection(socket)
{
    console.log("connected");
}

I've installed earlier version of node (0.8.25) using n - node version manager (https://npmjs.org/package/n), and everything started working fine. Thanks funseiki!