Forums Register Login

Working with Internet URL through Proxy from Java Code

+Pie Number of slices to send: Send
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 ?
+Pie Number of slices to send: Send
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
A magnificient life is loaded with tough challenges. En garde tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1640 times.
Similar Threads
Java Mail behind Proxy
java.net with Proxy
Working with Internet URL from Eclipse
Accessing Internet through Proxy Server
plz answer
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 02:27:14.