S
Sharp
Hi
I am trying to make a URL connection to a particular website through a
proxy-based firewall. But I am recieving a HTTP reponse code 407, which
suggest that I have an authenication problem. I have checked that my proxy
name, port, username and password is correct.
Code snippet
.....
System.setProperty("proxySet", "true");
System.setProperty("http.proxyHost", "XXX");
System.setProperty("http.proxyPort", "XXX");
System.setProperty("http.proxyUser", "XXX");
System.setProperty("http.proxyPassword", "XXX");
URL url = new URL ("http://www.hotmail.com");
URLConnection connection = connection = url.openConnection();
also tried
System.setProperty("proxySet", "true");
System.setProperty("http.proxyHost", "XXX");
System.setProperty("http.proxyPort", "XXX");
URL url = new URL ("http://www.hotmail.com");
URLConnection connection = url.openConnection();
String encodedPassword = Base64Coder.encode("username
assword");
connection.setRequestProperty("Proxy-Authorization", encodedPassword);
Any help appreciated.
Regards
Sharp
I am trying to make a URL connection to a particular website through a
proxy-based firewall. But I am recieving a HTTP reponse code 407, which
suggest that I have an authenication problem. I have checked that my proxy
name, port, username and password is correct.
Code snippet
.....
System.setProperty("proxySet", "true");
System.setProperty("http.proxyHost", "XXX");
System.setProperty("http.proxyPort", "XXX");
System.setProperty("http.proxyUser", "XXX");
System.setProperty("http.proxyPassword", "XXX");
URL url = new URL ("http://www.hotmail.com");
URLConnection connection = connection = url.openConnection();
also tried
System.setProperty("proxySet", "true");
System.setProperty("http.proxyHost", "XXX");
System.setProperty("http.proxyPort", "XXX");
URL url = new URL ("http://www.hotmail.com");
URLConnection connection = url.openConnection();
String encodedPassword = Base64Coder.encode("username
connection.setRequestProperty("Proxy-Authorization", encodedPassword);
Any help appreciated.
Regards
Sharp