首页 > 技术文章 > 解决Fiddler无法捕获本地HttpWebRequest(C#.net)请求和HttpURLConnection(Java)请求

snaildev 2018-04-10 09:47 原文

方法很简单,就是设置本地代理

C#

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

 

Java

jre -DproxySet=true -DproxyHost=127.0.0.1 -DproxyPort=8888 MyApp

或者

System.setProperty("http.proxyHost", "localhost"); 
System.setProperty("http.proxyPort", "8888"); 
System.setProperty("https.proxyHost", "localhost");
System.setProperty("https.proxyPort", "8888");

  

推荐阅读