how to monitor the network on node.js similar to chrome/firefox developer tools?

后端 未结 5 1798
猫巷女王i
猫巷女王i 2021-01-31 02:05

When developing client side javascript applications, the developer network panel is invaluable for debugging network issues:

5条回答
  •  后悔当初
    2021-01-31 03:04

    Use external HTTP Debugging tool. Your options include:

    • node-http-proxy as seen in How do I use node.js http-proxy for logging HTTP traffic in a computer?
    • middlefiddle written in node.js (but abandoned for 3 years now) https://github.com/mdp/middlefiddle
    • mitmproxy - a CLI tool http://mitmproxy.org
    • fiddler http://www.telerik.com/fiddler
    • and many more - https://www.google.pl/search?q=HTTP+debugger

    You fire up one of those, tell them where to route the traffic, and point your application at that debugging proxy instead of the real server.

提交回复
热议问题