aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes Reading proxy settings and applying in URL connection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Reading proxy settings and applying in URL connection" Watch "Reading proxy settings and applying in URL connection" New topic
Author

Reading proxy settings and applying in URL connection

dema rogatkin
Ranch Hand

Joined: Oct 09, 2002
Posts: 294
Just want to save some time dealing with search engines. For Windows platform primary, but for some others can be good too. I want to apply proxy settings to URL connection based on proxy settings set for IE/FF or other browser. I guess I can use package java.util.prefs for reading Windows Registry for proxy setting values. Then I can use
System.getProperties().put( "proxySet", "true" );
System.getProperties().put( "proxyHost", "proxyhost" );
System.getProperties().put( "proxyPort", "proxy port" );
Will it be sufficient? What about authentication? Should I set
connection.setRequestProperty( "Proxy-Authorization", login_password ); for every time when I do connection? Or these values can be preset?


Tough in space?, <a href="http://tjws.sf.net" target="_blank" rel="nofollow">Get J2EE servlet container under 150Kbytes here</a><br />Love your iPod and want it anywhere?<a href="http://mediachest.sf.net" target="_blank" rel="nofollow">Check it here.</a><br /><a href="http://7bee.j2ee.us/book/Generics%20in%20JDK%201.5.html" target="_blank" rel="nofollow">Curious about generic in Java?</a><br /><a href="http://7bee.j2ee.us/bee/index-bee.html" target="_blank" rel="nofollow">Hate ant? Use bee.</a><br /><a href="http://7bee.j2ee.us/addressbook/" target="_blank" rel="nofollow">Need contacts anywhere?</a><br /><a href="http://searchdir.sourceforge.net/" target="_blank" rel="nofollow">How to promote your business with a search engine</a>
ganesh pol
Ranch Hand

Joined: Apr 29, 2005
Posts: 151
i think following link has solution to our problem web page

please post the code if u find one
[ May 19, 2006: Message edited by: ganesh pol ]
dema rogatkin
Ranch Hand

Joined: Oct 09, 2002
Posts: 294
used MSN search and found :

So I expect that call

Should return current proxy settings. let me check.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Reading proxy settings and applying in URL connection