解决Fiddler无法捕获本地HttpWebRequest(C#.net)请求和HttpURLConnection(Java)请求

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

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");

  

posted @ 2018-04-10 09:47  snailteam  阅读(2958)  评论(0编辑  收藏  举报