Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Socket.io client debugging?

Tags:

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.

like image 517
disappearedng Avatar asked Jan 02 '12 09:01

disappearedng


People also ask

How do I debug Socket.IO in Chrome?

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.

What is socket IO client used for?

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.

What is the difference between Socket.IO and socket IO client?

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).


1 Answers

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'; 
like image 173
Lukas Liesis Avatar answered Dec 04 '22 17:12

Lukas Liesis