Friday, 21 September 2012

URLConnection with proxy authentication in java

Basic Proxy-Authorization is not longer working.
Use Authenticator for URLConnection with Proxy authentication.
Authenticator.setDefault(new Authenticator()
{
@Override
protected PasswordAuthentication getPasswordAuthentication()
{
return new PasswordAuthentication(proxyUsername,proxyPassword.toCharArray());
}
});

No comments:

Post a Comment