Reputation: 36490
Is there a way that I can know the connected socket.io client which transport is using? e.g. websocket / polling
I am using "socket.io-client": "2.0.1" + "socket.io": "2.0.1"
Thanks.
Upvotes: 0
Views: 380
Reputation: 1313
Server:
io.on('connection', function (socket) {
console.log(socket.conn.transport.name);
});
Client:
socket.io.engine.transport.name
Upvotes: 2