My Internet Explorer is set to have an automatic proxy file(so-called PAC) for web access. Is there a way to use this on my Java program, also ?
My below Java code does not seem to use proxy 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()); //output is just DIRECT T.T it should be PROXY.
}
I also set my proxy script on Java Control Panel(Control->Java), but the same result. and I found there's no way to set PAC file for Java programmatically.
People use http.proxyHost for System.setProperties(..) but this is a only for setting proxy host, not proxy script(PAC file).