actionscript 3 - Flash+Node.JS+Socket.io stuck at handshake authorized -
i'm writing small game, socket-based obviously. works fine when in localhost, when i'm running .swf file dedicated server, , trying connect node.js server, connection getting stuck @ "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 firewall or antivirus. tried running on different ports.
code example:
//setup express serving crossdomain on same port 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), , started working fine. funseiki!
Comments
Post a Comment