Q: How do I configure a proxy?

A: Proxy configuration can be accomplished several ways.

The first possibility is to setup system properties to specify proxy information.

This can be done by adding the following options to the command line used to launch Java:

-Dhttp.proxyHost=proxy.mycompany.com -Dhttp.proxyPort=80 -Dhttp.proxyUser=myusername -Dhttp.proxyPassword=mypassword

A second possibility under Java 1.4.x is to configure an Authenticator.

A. You can also set the system properties in the code level like this

System.setProperty("http.proxyHost","192.168.100.14");

System.setProperty("http.proxyPort","4480");

This is for those who use proxy application like proxy plus etc.

Q: Are there any caveats or gotchas with proxy support?

A: Current releases of Java only support proxy servers using basic authentication. In a nutshell, the username and password are base64 encoded and added as headers to the http request. Please see How to Base-64 for more information.

Under Java 1.4.2 on Windows, it appears that Sun has added support for NTLM authentication. Please see Enhancements and Changes in Java 2 SE Version 1.4.2 for further details.

NTLM authentication is commonly used with Microsoft Proxy Server. It is not directly possible to use NTLM authentication under earlier releases of Java without the use of third party software. (Don't waste your time).

For further details on Microsoft Proxy Server issues, please see: Unofficial Java Web Start/JNLP FAQ

For a technical discussion of NTLM, please see: The NTLM Authentication Protocol.

At present, it is recommended you use the Jakarta Commons HttpClient for NTLM support.

AxisProjectPages/AxisProxy (last edited 2009-09-20 23:33:13 by localhost)