Tuesday, 4 April 2017

Socket.io ping timeout

I'm having a very weird issue with socket IO which till a couple of weeks it worked well. The socket appears to connect and the initial sequence of 2probe, 3probe occurs. However it seems the socket starts the process of upgrading and never finishes. The state of socket.io.engine.upgrading is always true till the logs indicate a socket.io-client:socket close (ping timeout) and it attempts to reconnect, only for the same thing to occur

Socket.io being used is version 1.7.2

Scenario

Node.js server running on port 443

var options = {
    key: fs.readFileSync(config.server.ssl.keyPath),
    cert: fs.readFileSync(config.server.ssl.certPath)
};
var ioServer = https.createServer(options, app);

var port = (config.server.ssl && config.server.ssl.enabled) ? 443 : process.env.PORT || config.server.port;
io  = require('socket.io').listen(ioServer);

Client side is a webapp using require

socket = require('socket.io-client')();

any ideas?



via user584569

No comments:

Post a Comment