Solution: fiddler cannot listen to Java httpurlconnection requests

Source: Internet
Author: User

By default, Fiddler cannot listen to Java httpurlconnection requests. The reason is that the Java Network Communication Protocol Stack may be slightly different from the browser's communication protocol stack. The principle of Fiddler listening to HTTP requests is in ApplicationProgramA proxy server is built between the network communication layer of the operating system, and Java's httpurlconnection should bypass this proxy server, so Fiddler cannot listen to Java httpurlconnection requests.

The basic idea of resolving Fiddler's inability to listen to Java httpurlconnection requests is to set up a proxy server.

The solution provided by the fiddler official website (see http://www.fiddler2.com/fiddler/help/hookup.asp#Q-JavaTraffic) is to set JVM parameters, such

JRE-dproxyset = true-dproxyhost = 127.0.0.1-dproxyport = 8888 MyApp

The cool people on stackoverflow also gaveCodeTo set the proxy server (see the http://stackoverflow.com/questions/8549749/how-to-capture-https-with-fiddler-in-java), as shown in

System. setproperty ("HTTP. proxyhost", "localhost ");
System. setproperty ("HTTP. proxyport", "8888 ");
System. setproperty ("HTTPS. proxyhost", "localhost ");
System. setproperty ("HTTPS. proxyport", "8888 ");

Of course, it is better to hope that Fiddler itself can increase the ability to listen to Java httpurlconnection requests.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.