Fiddler没有从我的C#应用​​程序捕获流量

时间:2016-04-21 17:33:37

标签: c# fiddler fiddlercore

我尝试在Windows 10 x64上使用Fiddler,在Oracle VM中使用Windows 7 Ultimate x86作为访客,以及使用Fiddler2和Fiddler4,FiddlerCore和Charles代理在win 10上使用。

那些(Fiddler2,4,Core和Charles代理)捕获来自我的浏览器的所有流量,包括甚至Visual Studio更新请求(或某些微软服务器VS会话),但所有上述设置都无法捕获我的应用程序的流量 - 从调试或已发布的文件夹运行,或直接从VS调试器运行,在x64和x86中。

我使用VS 2015,目标是.net 4.5 此外,我没有主机操作系统的完全管理员权限(胜利10),这可能是一个问题。

首先开始提琴手和/或作为管理员赢得了工作。同时启动我的应用程序或VS作为管理员也不会工作。

同时编辑machine.config也没有工作,甚至没有.net部分(可能在win10中),我修改了.web。

是否有一些库会在应用程序级别而不是操作系统级别上记录请求和响应?

2 个答案:

答案 0 :(得分:5)

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)

答案 1 :(得分:0)

如果流量已加密,请在Fiddler中转到:

工具-选项-HTTPS-解密HTTPS流量。安装证书。

然后,您应该可以右键单击列表中的URL,然后保存完整的请求和响应。