For some reason, the connection event fires when I connect from my local machine. But when I connect from another machine, it serves the socket io but it doesn't spit out any feedback and non of the console output, that is supposed to fire, does.
The following is run when the server is started:
startSocketService : function(http,fn){
ar pub = redis.createClient();
var sub = redis.createClient();
var client = redis.createClient();
var service = io.listen(http); //http is just the ExpressJS service
service.enable('browser client minification');
service.enable('browser client etag');
service.set('transports', [
'websocket'
, 'flashsocket'
, 'htmlfile'
, 'xhr-polling'
, 'jsonp-polling'
]);
service.set('store',new RedisStore({
redisPub: pub,
redisSub: sub,
redisClient: client
}));
console.log('Socket service listening on port '+config.ports.http);
service.sockets.on('connection',function(socket){
console.log("Incoming Socket Connection -> ",socket.id);
if(typeof fn === 'function'){fn(socket);} //this is just a callback
});
}
That console.log, as well as all console.log's in the callback, only fire when I connect from 127.0.0.1. Any outside connections do not output to the console, yet they seem to be working. They also seem to have a unique socket id. This still worries me. I can't test anything with it like this!
The problem was client side. I was pointing to 127.0.0.1, so on other machines they were pointing to their own local instance.