Does socket.io have a client side debug mode where you can literally see everything that the server has sent over to you?
Now you achieve the same effect with the following code:
socket.on('HELLO', function(arg1, arg2) { console.log('HELLO', arg1, arg2) ... socket.on('WORLD', function(arg1) { console.log('WORLD', arg1) ...
It would be really convenient if I can do this easily without putting console.log everywhere.
Turn on the Chrome Developer Tools. Click Network, enable filter (3rd icon from the left on the top of Dev Tools) to filter the traffic shown by the Developer Tools, and click WebSockets. In the Echo demo, click Connect. On the Headers tab in Google Dev Tool you can inspect the WebSocket handshake.
Socket.IO is a library that enables low-latency, bidirectional and event-based communication between a client and a server. It is built on top of the WebSocket protocol and provides additional guarantees like fallback to HTTP long-polling or automatic reconnection.
socket-io. client is the code for the client-side implementation of socket.io. That code may be used either by a browser client or by a server process that is initiating a socket.io connection to some other server (thus playing the client-side role in a socket.io connection).
Paste this to console, click enter and refresh your page:
localStorage.debug = '*';
To get only debug info with incoming data from socket, paste this instead:
localStorage.debug = 'socket.io-client:socket';
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