3

I've tried using Fiddler on Windows 10 x64 and on Windows 7 Ultimate x86 in Oracle VM as a guest, and on the Win 10 as well, with Fiddler2 and Fiddler4, FiddlerCore and Charles proxy.

Those (Fiddler2, 4, Core, and Charles proxy) capture all the traffic from my browsers, including even Visual Studio update requests (or some microsoft servers VS talks to), but all of the above mentioned setups fail miserably to capture traffic from my app - ran from debug or released folder, or directly from VS debugger, both in x64 and x86.

I use VS 2015, targeting .net 4.5 Also I don't have full admin rights on the host OS (win 10), which might be an issue.

Starting Fiddler first and/or as admin won't work. Starting my app or VS as admin won't work either.

Editing machine.config won't work, there isn't even .net section (in win10 probably), I modified the .web one.

Is there a library that will log requests and responses on app level instead of OS level?

live-love
  • 34,372
  • 16
  • 163
  • 152
codingcoder
  • 31
  • 1
  • 3

1 Answers1

7

Your requests are not going through the system's proxy (which Fiddler modifies, and that's how it intercepts your traffic). There are several ways you can configure your .NET apps to go through one. Fiddler documentation specifies it.

But basically:

  1. Specify a proxy in your exe config:

    <configuration>
     <system.net>
      <defaultProxy>
       <proxy bypassonlocal="false" usesystemdefault="true" />
      </defaultProxy>
     </system.net>
    </configuration>
    
  2. Manually specify it on the requests:

    objRequest = (HttpWebRequest)WebRequest.Create(url);
    objRequest.Proxy= new WebProxy("127.0.0.1", 8888);

Also, most .NET classes bypass the proxy if accessing localhost. In this case, use ip4.fiddler as a host instead of localhost (or ipv6.fiddle for IPv6)

Jcl
  • 24,674
  • 5
  • 55
  • 81