简体   繁体   中英

Can't Get Fiddler to Capture local traffic to IIS

I have recently installed the latest Fiddler (Fiddler4) and absolutely nothing that I try is working to get it to capture local traffic. I have an MVC application that is connecting to an MVC WebApi app both running on IIS, here's what I've tried:

  • Fiddler Options > Connections > Monitor All Connections & Use PAC Script
  • Changed the WebClient C# call to use the following URLs with no success:
  • Changed my "Default Website" in IIS to run under a new AppPool that uses my local account, and ran Fiddler as administrator
  • added <system.net> <defaultProxy> <proxy bypassonlocal="False" usesystemdefault="True" /> </defaultProxy> </system.net> to my web.config of the MVC app.

Nothing has worked, I have no idea what to try. Any advice is greatly appreciated. Thanks, Shawn

It turned out that I needed to set up Fiddler as a reverse proxy ( http://fiddler2.com/documentation/Configure-Fiddler/Tasks/UseFiddlerAsReverseProxy ). I don't really understand why before I upgraded from Fiddler2 to Fiddler4 I didn't have to do this. I used to be able to just use http://ipv4.localhost/app-name and all worked fine. In order to get it working with Fiddler4, though, I set-up the reverse proxy, and then changed all my requests from http://ipv4.localhost/app-name to http://machinename:8888/app-name . I can now listen in to inter-app communications. Any idea why I didn't have to do this with Fiddler2, but I now do after upgrading to Fiddler4?

I know you mentioned this in your OP, but this worked for me and was super simple to do, so I thought I would share in case others run into the same problem and don't want to go through the trouble of setting up a reverse proxy if they don't need to.


I got this to work by simply changing the IIS Application Pool whose traffic I wanted to inspect to run under my identity, since Fiddler seems to only capture traffic of the logged in user by default. Just make sure your user has all of the necessary permissions required by IIS; I'm an admin so this wasn't an issue for me. And of course, don't forget to change the IIS Application Pool identity back when you are done.

The other option of course is to instead log in as the user that the IIS Application Pool is running as (if it's not a service account like Network Service ) and then run Fiddler while logged in as that other user.

The easiest reliable solution I know to capture non-Webbrowser traffic is to explicitly specify Fiddler's port as proxy for web requests. Depending on requests your code is making code would look similar to:

 request.Proxy = new WebProxy("127.0.0.1", 8888)

Note: don't forget to run Fiddler with "Capturing" and "All Process" (visible in status bar of Fiddler)

Try adding a record in your hosts file (c:\\windows\\system32\\drivers\\etc\\hosts), like:

127.0.0.1   mysite.local

You'll then need a binding in your website in IIS to match.

Then use http://mysite.local/

Try using http://machinename./page

ie.. try suffixing a period to the machine name and browse.

I got the same issue. fixed by modifying Web.config

<system.net>
    <defaultProxy enabled="true">
        <proxy proxyaddress="http://127.0.0.1:8888" bypassonlocal="False"/>
    </defaultProxy>
</system.net>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM