4

Is it possible to get the system proxy configuration in Java?

In the Java Control Panel, you can set a proxy configuration. How can I access to that proxy configuration in order to open URL connections behind a proxy?

Auron
  • 13,626
  • 15
  • 47
  • 54

2 Answers2

3

oh, just look at that question. there was a sample with a solution.

currently all samples I've seen use SUN's undocumented APIs (com.sum packages), which result in warnings at compile time...

Community
  • 1
  • 1
Anton Kraievyi
  • 4,182
  • 4
  • 26
  • 41
1

The Java Plugin gets it from the system settings. If the app has to be started as either applet or webstart you can use the webstart/applet APIs for this. Otherwise you have to use native code. Look at the various JniWrapper's WinPack and the JDIC libs - they might have done the heavy lifting for you.

ddimitrov
  • 3,293
  • 3
  • 31
  • 46