Can't Get Fiddler to Capture local traffic to IIS

后端 未结 6 1357
南旧
南旧 2021-02-07 18:32

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 conne

相关标签:
6条回答
  • 2021-02-07 19:11

    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?

    0 讨论(0)
  • 2021-02-07 19:15

    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/

    0 讨论(0)
  • 2021-02-07 19:25

    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>
    
    0 讨论(0)
  • 2021-02-07 19:27

    Try using http://machinename./page

    i.e... try suffixing a period to the machine name and browse.

    0 讨论(0)
  • 2021-02-07 19:29

    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.

    0 讨论(0)
  • 2021-02-07 19:35

    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)

    0 讨论(0)
提交回复
热议问题