Dears,
Regarding HTTP communications, I would like to auto-detect proxy settings based on system settings.
I can get information on manually configured proxy, using the following code:
import java.net.Proxy;
import java.net.ProxySelector;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.List;
public class Test {
public static void main(String[] args) {
System.setProperty("java.net.useSystemProxies", "true");
try {
List<Proxy> list = ProxySelector.getDefault().select(new URI("http://www.google.be/"));
for(int i=0; i<list.size(); i++){
System.out.println(list.get(i));
}
} catch (URISyntaxException e) {
e.printStackTrace();
}
}
}
But ...
I haven't found a way yet to get proxy information from automatic proxy configuration script (pac files).
Has anyone encountered/solved this problem yet?
Many thanks for your help,
Eric