Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
タイトルの通りです。Socket.io を使用して Node.js サーバーが送受信するパケットのサイズを確認しようとしています。
「パケット」の下で何を理解しているかによって異なります。それがあなたが求めているペイロードだけである場合、ProblemFactory は正しい答えを持っています。socket.io パッケージ自体のサイズを取得しようとしても、socket.io API を使用して取得することはできません。
JSON.stringify(response).lengthトリックを行う必要があります。
JSON.stringify(response).length