Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to apply all browser proxy settings into Java

 
Jack Bush
Ranch Hand
Posts: 235
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 235
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic