How can I make URL connections through a proxy server?

John Zukowski

Java uses two system properties to designate a proxy: http.proxyHost and http.proxyPort. For applets, these are automatically set to use the browser's settings. However, in an application you need to set them yourself:

Properties props = System.getProperties();
props.put("http.proxyHost", "proxyhostname");
props.put("http.proxyPort", "proxyhostport");
0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact