What is the solution to using socket.io module from behind corporate firewall/proxy? This is the code I am using.
// setup express server
var app = express()
var serv = http.createServer(app);
serv.listen(80);
// setup socket io - listens in on express store as well for sessions
var io = require('socket.io').listen(serv);
I had a similar issue and I ended up disabling websocket entirely:
io.configure('production', function(){
io.set('transports', ['xhr-polling']);
});
XHR-polling works everywhere, but has a much bigger overhead for everyone (even if only 5% of users actually need it).
Good news is, the upcoming 1.0 version of Socket.IO will fix this:
Unlike the previous Socket.IO core, it always establishes a long-polling connection first, then tries to upgrade to better transports that are "tested" on the side.
Check it here: https://github.com/LearnBoost/engine.io
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With