A
A
Alexey Volodin2016-02-17 12:31:32
JavaScript
Alexey Volodin, 2016-02-17 12:31:32

How to get all events coming from the server using socket.io?

Please tell me if it is possible on the client side to log all events coming from the server.
Perhaps something like:

socket.on('*', function(event, data) {
                console.log('Event received: ' + event + ' - data:' + JSON.stringify(data));
            });

The current version does not work.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Volodin, 2016-02-17
@alexeyvolodin

Understood
In the console, we write the following and update the page:
To receive only incoming messages, then insert another code into the console and also update the page:
localStorage.debug = 'socket.io-client:socket';

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question