Java using Proxy
July 10th, 2009 Posted in Java
Shows how to set the configuration in a Java program behing a Proxy server.
Many times we want to use the internet connection in our java programs for many reasons, but if we are behind a proxy server, we need to set some properties in the JVM to be able to do the request to the proxy and then go out into internet network.
It is as simple as set this two properties
System.getProperties().put( "http.proxyHost", "10.0.0.1" ); System.getProperties().put( "http.proxyPort", "3128" );
and this will do the trick.