How to capture http messages from Request Node library with Fiddler

前端 未结 5 1206
清酒与你
清酒与你 2021-02-12 12:33

Regular client initiated requests to the node server are captured fine in Fiddler. However, requests sent from node to a web service are not captured. It did not help to pass in

5条回答
  •  一向
    一向 (楼主)
    2021-02-12 12:58

    To do this on an ad-hoc basis, without changing your code, you can use environment variables.

    Request respects:

    • HTTP_PROXY
    • HTTPS_PROXY
    • NO_PROXY

    So, to proxy just set these in your console before running your process.

    For example, to setup http and https proxy use:

    set HTTP_PROXY="http://127.0.0.1:8888"
    set HTTPS_PROXY="http://127.0.0.1:8888"
    set NODE_TLS_REJECT_UNAUTHORIZED=0
    

    The latter line stops issues with SSL through the fiddler proxy.

提交回复
热议问题