This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Java in General and the fly likes Working with Internet URL through Proxy from Java Code Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Working with Internet URL through Proxy from Java Code" Watch "Working with Internet URL through Proxy from Java Code" New topic
Author

Working with Internet URL through Proxy from Java Code

Thirugnanam Saravanan
Ranch Hand

Joined: Dec 13, 2007
Posts: 81
I am trying to execute a java Program which attempts to copy a file from internet URL to my local disk.

I am using the following code for getting connection to the URL.




My system is connected to internet through proxy server. I am using ECLIPSE IDE for executing this Java ProgramIn ECLIPSE I have entered the proxy host, proxy port, proxy authentication details in the Windows --> Preferences --> Internet --> Proxy Settings window.

But when I execute the above Code,it displays an exception java.net.UnknownHostException.

Any ideas on how to connect to Internet URL from a system which is behind the Proxy Server ?


Saravanan
SCJP 5.0(98%), SCWCD 5.0 (100%), OCA
Sivaraman Lakshmanan
Ranch Hand

Joined: Aug 02, 2003
Posts: 231
Hi Saravanan,
This article will help you. You have to set the proxy host in the System.property before calling the URLConnection.

Working with Proxy


Regards,
Sivaraman.L
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Working with Internet URL through Proxy from Java Code
 
Similar Threads
Accessing Internet through Proxy Server
java.net with Proxy
plz answer
Working with Internet URL from Eclipse
Java Mail behind Proxy