I would like to test my engine.io server with multiple connections. I am trying to open sockets in loop, but output is only one socket.
In socket.io-client I added forceNew: true
and fixed the issue but not working with engine.io-client.
for (var i=0;i<10;i++){
var socket = require('engine.io-client')('ws://localhost');
socket.on('open', function(){
console.log('socket opened : '+socket.id);
socket.on('message', function(data){
console.log('data is '+data);
});
socket.on('close', function(){
console.log('socket closed : '+socket.id);
});
});
}
With the socket.io-client, you have to set
multiplex: false
.More at: http://socket.io/docs/client-api/
However, there seems to be no such implementation for "engine.io-client" and I don't think there will be either.
From: https://github.com/Automattic/engine.io