Fiddler抓取Java应用本地的HTTP请求报文

1,监听Tomcat的http请求报文

在catalina.bat添加一行(proxyPort的值为fiddler端口号)

set CATALINA_OPTS=-Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=8888

2,Java程序中监听

在Java代码中通过以下方式设置代理

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

https://stackoverflow.com/questions/8549749/how-to-capture-https-with-fiddler-in-java

猜你喜欢

转载自blog.51cto.com/dengshuangfu/2553026
今日推荐