V
vj
Hi,
I am creating a URLConnection object behind a firewall and facing some
serious problems.
The thing goes on smooth untill firewall does not enforces security. As
soon as user authorization is enforced the thing stops working. The
firewall is HTTP working on port 8080 of localhost. Here is the code
that i am using
/*************************CODE************************/
Properties systemSettings = System.getProperties();
System.setProperties(systemSettings);
URL url=new URL("http://someserver/somepage");
URLConnection uc = url.openConnection ();
String encoded = new String
(Base64.base64Encode(new
String("usernameassword").getBytes()));
uc.setRequestProperty("Proxy-Authorization", "Basic " + encoded);
System.out.println("Connecting...");
uc.connect();
InputStream is= uc.getInputStream();
System.out.println("Connected and retriving data...");
/***********************************************************/
the main problem is that as soon as authorization is enforced the
programs freezes after giving the output "Connecting..." !!!
Any ideas what really is the problem. I have tried googling and tried
all sorts of methods that were suggested on the web.
Thanks,
VJ
I am creating a URLConnection object behind a firewall and facing some
serious problems.
The thing goes on smooth untill firewall does not enforces security. As
soon as user authorization is enforced the thing stops working. The
firewall is HTTP working on port 8080 of localhost. Here is the code
that i am using
/*************************CODE************************/
Properties systemSettings = System.getProperties();
System.setProperties(systemSettings);
URL url=new URL("http://someserver/somepage");
URLConnection uc = url.openConnection ();
String encoded = new String
(Base64.base64Encode(new
String("usernameassword").getBytes()));
uc.setRequestProperty("Proxy-Authorization", "Basic " + encoded);
System.out.println("Connecting...");
uc.connect();
InputStream is= uc.getInputStream();
System.out.println("Connected and retriving data...");
/***********************************************************/
the main problem is that as soon as authorization is enforced the
programs freezes after giving the output "Connecting..." !!!
Any ideas what really is the problem. I have tried googling and tried
all sorts of methods that were suggested on the web.
Thanks,
VJ