In order to work with a proxy, your
Java application needs to specify information about the proxy itself as well as specify user information for authentication purposes.
System.getProperties().put( "proxySet", "true" );
System.getProperties().put( "proxyHost", "proxyHost" );
System.getProperties().put( "proxyPort", "85" );
Some proxies require a user to type in a username and password before Internet access is granted. Here's how to perform the authentication:
URLConnection connection = url.openConnection();
String password = "username
assword";
String encodedPassword = base64Encode( password );
connection.setRequestProperty( "Proxy-Authorization", encodedPassword );
SCJP,SCJD SCEA, SCWCD, SCBCD<br />OCP DBA 8i / 9i<br />CISSP, PMP, PHR<br />CCNA, CCDA <br /><a href="http://www.certgear.com" target="_blank" rel="nofollow">http://www.certgear.com</a>