Reputation: 108
Just as in title. I am trying to check the size of the packets sent and received by Node.js server using Socket.io.
Upvotes: 2
Views: 1741
Reputation: 2788
Depends on what you understand under 'packets'. If it is just the payload you are after, then ProblemFactory has the correct answer. Trying to get the size of the socket.io packages themselves, is not possible through the socket.io API.
Upvotes: 2
Reputation: 9811
JSON.stringify(response).length
should do the trick.
Upvotes: 2