Saba
Saba

Reputation: 3666

Get events listened by socket

I am listening to many events on a socket. But when event is fired, the handler function does not get called. I want to check which events are listened by the socket.

var socketClient = require('socket.io-client');
var socket = socketClient.connect("server_address_here");
socket.on('event1', function (data) {

});

socket.on('event2', function (data) {

});

Are there any functions or properties available?

Upvotes: 4

Views: 385

Answers (1)

Saba
Saba

Reputation: 3666

The versions of node and socket.io on server(using socket.io-client) should match to the respective versions on socket.io server.

Also, the [email protected] seems to be stable build for this package (as I read in many online references).

Upvotes: 1

Related Questions