How to configure Fiddler to listen to localhost?

后端 未结 16 2212
长情又很酷
长情又很酷 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:58

    Replace localhost with 127.0.0.1 If it doesn't work change the run configuration to support your ip address.

    0 讨论(0)
  • 2020-12-02 09:59

    .NET and Internet Explorer don't send requests for localhost through any proxies, so they don't come up on Fiddler.

    Many alternatives are available

    Use your machine name instead of localhost. Using Firefox (with the fiddler add-on installed) to make the request. Use http://ipv4.fiddler instead of localhost.

    For more info http://www.fiddler2.com/Fiddler/help/hookup.asp

    0 讨论(0)
  • 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

    0 讨论(0)
  • 2020-12-02 10:00

    If you're using FireFox, Fiddler's add-on will automatically configure it to not ignore localhost when capturing traffic. If traffic from localhost is still (or suddenly) not appearing, try disabling and re-enabling traffic capture from Fiddler to goad the add-on into fixing the proxy configuration.

    0 讨论(0)
  • 2020-12-02 10:00

    This is easy. Just grab your computer's IP address with IPconfig at the command prompt. Then, hit the service using the IP address rather than localhost. You don't need to do anything to Fiddler to make this work, it will just work by itself.

    0 讨论(0)
  • 2020-12-02 10:01

    Rather than configure the application server and client to use another domain, you may want to configure the client application to use a proxy. Fiddler also creates a proxy you can use, logging all traffic. Rick Strahl blogged about using this in .NET Apps, I am always misplacing this blog post, so let me link it here: http://weblog.west-wind.com/posts/2008/Mar/14/Debugging-Http-or-Web-Services-Calls-from-ASPNET-with-Fiddler.

    To be brief, the app.config change is:

    <system.net>
      <defaultProxy>
        <proxy  proxyaddress="http://127.0.0.1:8888" />      
      </defaultProxy>
    </system.net>
    
    0 讨论(0)
提交回复
热议问题