Configure TimeOut and Transports in Socket.IO 1.0

In older versions of Socket.IO (<0.9), I configured the "close timeout" and "transports" as follows:

io.set("transports", ["xhr-polling"]);
io.set("close timeout", 3);

But now the team is io.setout of date. How to determine the time close timeoutand transports?

When I use the old version, this message appears:

The timeout close option is invalid.

+3
source share
1 answer

See the documentation here: http://socket.io/docs/migrating-from-0-9/#configuration-differences

Basically, you just need to install them when you initialize the server:

var socket = require('socket.io')({
  // options go here
});
+2
source

All Articles