How to configure Fiddler to listen to localhost?

后端 未结 16 2232
长情又很酷
长情又很酷 2020-12-02 09:51

I want to monitor HTTP traffic between a process on my local machine and another (server) process, also running on my local machine.

How can I configure Fiddler to

16条回答
  •  心在旅途
    2020-12-02 09:59

    The Light,

    You can configure the process acting as the client to use fiddler as a proxy.

    Fiddler sets itself up as a proxy conveniently on 127.0.0.1:8888, and by default overrides the system settings under Internet Options in the Control Panel (if you've configured any) such that all traffic from the common protocols (http, https, and ftp) goes to 127.0.0.1:8888 before leaving your machine.

    Now these protocols are often from common processes such as browsers, and so are easily picked up by fiddler. However, in your case, the process initiating the requests is probably not a browser, but one for a programming language like php.exe, or java.exe, or whatever language you are using.

    If, say, you're using php, you can leverage curl. Ensure that the curl module is enabled, and then right before your code that invokes the request, include:

    curl_setopt($ch, CURLOPT_PROXY, '127.0.0.1:8888');

    Hope this helps. You can also always lookup stuff like so from the fiddler documentation for a basis for you to build upon e.g. http://docs.telerik.com/fiddler/Configure-Fiddler/Tasks/ConfigurePHPcURL

提交回复
热议问题