How do I set the polling interval for xhr fallback for socket.io 1.0? It looks like it polls every second when not in websocket mode but I'd prefer if the polling interval is every 2 seconds to reduce load on the server.
I read through the documentation for both socket.io and engine.io about the options object but couldn't find anything in there that would set polling interval.
js) and the Socket.IO client (browser, Node. js, or another programming language) is established with a WebSocket connection whenever possible, and will use HTTP long-polling as fallback.
Xhr-polling creates new request with http header and waits for answer with http header, also sequential order.
Note: You can use either https or wss (respectively, http or ws ).
io.set("polling duration", 2);
Although "set" is gone. So I think that you will have to do it in Server initialization
var socket = require('socket.io')({
"polling duration": 2
});
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