My Internet Explorer has an automatic proxy file (called a PAC) for accessing the network. Is there a way to use this in my Java program, too?
My below Java code does not seem to use proxies at all.
ArrayList<Proxy> ar = new ArrayList<Proxy>(ProxySelector.getDefault().select(new URI("http://service.myurlforproxy.com")));
for(Proxy p : ar){
System.out.println(p.toString());
}
I also install my proxy script in the Java control panel (Control-> Java), but the same result. and I did not find there any way to install the PAC program file for Java programmatically.
People use http.proxyHost for System.setProperties (..), but this is only for setting a proxy host, not a proxy script file (PAC file).
source
share