Is there a way of getting internet connection settings (proxy information) being used by java to connect to the internet?
With Java 1.5 you can use the ProxySelector introduced then, is there any way of doing it in jdk1.4?
I tried getting these seeting using the following code snippet, but returning nulls even though i have set my proxy.
String javaVersion = System.getProperty("java.version");
String ip = null;
String port = null;
String noProxyHosts = null;
if (javaVersion.startsWith("1.4")) {
ip = System.getProperty("proxyHost");
port = System.getProperty("proxyPort");
noProxyHosts = System.getProperty("http.nonProxyHosts");
} else {
ip = System.getProperty("deployment.proxy.http.host");
port = System.getProperty("deployment.proxy.http.port");
noProxyHosts = System.getProperty("deployment.proxy.override.hosts");
}
A brief background; I have a webstart Java application that spawns an internal web browser which needs these setting to get going.