我需要知道如何使用socketaddress在HtmlUnit中设置代理? 我试过以下......
System.setProperty("socksProxyHost", "myHOST");
System.setProperty("socksProxyPort", "myPORT");
WebClient wb = new WebClient();
ProxyConfig pro = new ProxyConfig("172.22.218.218", 8085);
pro.setSocksProxy(true);
wb.setProxyConfig(pro);
wb.setRedirectEnabled(true);
这是我得到错误的地方..!
HtmlPage p = (HtmlPage) wb.getPage("http://google.com/");