fiddler抓取java系程序的网络通信
From http://stackoverflow.com/questions/9620720/fiddler-not-capturing-http-requests-from-java-application
You can simply set Fiddler as HTTP proxy for your application by setting the properties
http.proxyHost
to localhost and http.proxyPort
to 8888 for HTTP traffic and https.proxyHost
/ https.proxyPort
for HTTPS traffic.
For HTTPS traffic you also have to add the Fiddler root certificate (exportable in options dialog) as trusted certificate to your application.
You can do so by adding the following lines at the beginning of your code
System.setProperty("http.proxyHost","localhost");
System.setProperty("http.proxyPort","8888");
or set them via command line when starting the Java-VM:
java -Dhttp.proxyHost=localhost -Dhttp.proxyPort=8888...