Wednesday, November 10, 2004

Setting HTTP Proxy settings in a Java application

If you've been struggling with getting your network-based java application to work through a proxy,here're the property settings to use:

For HTTP:

System.setProperty("http.proxyHost","Proxy-Server-host");
System.setProperty("http.proxyPort","Proxy-Server-port");


For HTTPS:

System.setProperty("https.proxyHost","Proxy-Server-host");
System.setProperty("https.proxyPort","Proxy-Server-port");

No comments: