Two Laptop Bag*
The moose likes Sockets and Internet Protocols and the fly likes getting URLconnection when the client is behind a proxy Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "getting URLconnection when the client is behind a proxy" Watch "getting URLconnection when the client is behind a proxy" New topic
Author

getting URLconnection when the client is behind a proxy

mustang india
Ranch Hand

Joined: Feb 05, 2002
Posts: 60
HI,
I want to write a java client which connects toa praticular server and download a file. How will I get the URLConnection when I am behind a firewall ?
Anybody pl suggest.
Regards,
Mustang.
Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
Off the top of my head, set the http.proxyHost and http.proxyPort system properties. If you have an authenticating proxy, it's a bit more complicated than that because you've got to code authentication callbacks.
- Peter
mustang india
Ranch Hand

Joined: Feb 05, 2002
Posts: 60
HI Peter,
Thanks for the reply. I have an authenticating proxy..what can I do for that ?
Regards,
Mustang.
aminur rashid
Ranch Hand

Joined: Sep 21, 2001
Posts: 79
To get authentication use this class

Now call the class before making urlconnection

Enjoy


Regards<br />Aminur
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: getting URLconnection when the client is behind a proxy
 
Similar Threads
Authentication
How can I close a URLConnection?
Communicate with the server without a browser.
from a applet how can i call a servlet??
HTTP POST - does vanilla web page do URL encode?