File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Sockets and Internet Protocols and the fly likes How to apply all browser proxy settings into Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "How to apply all browser proxy settings into Java" Watch "How to apply all browser proxy settings into Java" New topic
Author

How to apply all browser proxy settings into Java

Jack Bush
Ranch Hand

Joined: Oct 20, 2006
Posts: 235
Dear Java Experts,

I am trying to apply the same proxy server settings on both Internet Explorer 8.0 & Mozilla Firefox 17.0.1 in Java but not sure how some of them are done such as in the following examples:

Internet Explorer
( i ) Proxy server => Use a proxy server for your LAN (These settings will not apply to dial-up or VPN connections) - checked
=>Bypass proxy server for local addresses – checked
( ii ) => Advanced => Proxy Settings => HTTP: Proxy address to use -127.0.0.1, Port – 8555
( iii ) => Exceptions, Do not use proxy server for addresses beginning with:127.0.0.1;localhost;10.*;192.168.*;127.0.0.1:895;127.0.0.1:896


Mozilla Firefox

( a ) Manual proxy configuration:
HTTP Proxy: 127.0.0.1, Port: 8555
( b ) No Proxy for: localhost, 127.0.0.1

Below is a general working code snippet for setting simple proxy server:



What are the remaining systems properties require to include all remaining browser configured proxy server settings into this Java program?

This is a Java jdk1.7.0_11 on Windows XP & 7 environment.

Your assistance would be much appreciated.

Thanks,

Jack
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4659
    
    5

You have to implement the proxy support code in your application. I don't see anything in your code snippet that does that.
Jack Bush
Ranch Hand

Joined: Oct 20, 2006
Posts: 235
Hi Pat,

I can't see anywhere in the program that has implemented the proxy support code in this application. Can you provide or refer to examples of how it is done?

Thanks again,

Jack
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4659
    
    5

I don't have a clean example code snippet. You have to change your HTTP requests to go to the proxy server, passing the original URL as data. You can probably google up an example, or worst case, read the RFCs
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to apply all browser proxy settings into Java