0

我有一个基于联合库的简单抓取程序,需要以编程方式设置和更改代理。

private static void setProxy(){
        System.setProperty("https.proxyHost", ProxyProducer.getProxy()); // this class just returns host address from list
        System.setProperty("https.proxyPort", ProxyProducer.PORT);
        ProxyAuthenticator.setCredentials(ProxyProducer.LOGIN, ProxyProducer.PASSWORD); //Joint's authentificator-wrapper
    } 

但它不起作用。没有错误,没有代理应用,响应正常但没有代理。这可能是因为Windows吗?我有 10 个并且在启动时没有请求权限,与许多程序相比很奇怪。

4

0 回答 0