Proxy Settings
Home ] Up ] Protocols ] Resource Names ] Absolute vs. Relative URLs ] The URL Class ] Reading from a URL ] [ Proxy Settings ]

 

 

If you are using an HTTP proxy (for example if you are sitting behind a firewall) and need to access the URL through this proxy, then the following properties allow you to specify the proxy settings:

  • http.proxyHost -- the name of the proxy host
  • http.proxyPort -- the proxy host port number

If you fail to do this, then you will likely fail to read the URL properly.

Here's an example of the kind of code you'd write to set these system properties:

    System.setProperty("http.proxyHost", "my-proxyhost.my-domain.com");
    System.setProperty("http.proxyPort", "89");
 
The page was last updated February 19, 2008