title: how to monitor the network on node.js similar to chrome/firefox developer tools?
body: <p>When developing client side javascript applications, the developer network panel is invaluable for debugging network issues:</p>
  
  <p><img src="https://i.stack.imgur.com/Q6bWm.png" alt="enter image description here"></p>
  
  <p>How does a developer creating a NodeJS application monitor the network traffic from the nodejs application to a http/https server?  For example how to debug the following network traffic?</p>
  
  <pre><code>var http = require('http');
  var req = http.request ...
  req.write ...
  req.send()
  </code></pre>
  
  <p>My code is making a call to a third party https server, so I am unable to use wireshark or similar packet sniffing tools.</p>
  
  <p>For more information, the problem I am trying to investigate is <a href="https://stackoverflow.com/questions/28813523/error-socket-hang-up-using-node-v0-12-0">here</a>.</p>
  
  <p>EDIT:</p>
  
  <p>Here are similar questions asking how to do the same thing in other languages:  </p>
  
  <ul>
  <li>PYTHON: <a href="https://stackoverflow.com/questions/10588644/how-can-i-see-the-entire-http-request-thats-being-sent-by-my-python-application">How can I see the entire HTTP request that&#39;s being sent by my Python application?</a></li>
  <li>JAVA: <a href="https://stackoverflow.com/questions/3246792/how-to-enable-logging-for-apache-commons-httpclient-on-android">How to enable logging for apache commons HttpClient on Android</a></li>
  </ul>