public InputStream httpGetLowLevel(URL url) throws IOException { WebRequest wrq=new WebRequest(url); ProxyConfig config =webClient.getProxyConfig(); //set request webproxy wrq.setProxyHost(config.getProxyHost()); wrq.setProxyPort(config.getProxyPort()); wrq.setCredentials(webClient.getCredentialsProvider().getCredentials(new AuthScope(config.getProxyHost(), config.getProxyPort()))); for(Cookie c:webClient.getCookieManager().getCookies(url)){ wrq.setAdditionalHeader("Cookie", c.toString()); } WebResponse wr= webClient.getWebConnection().getResponse(wrq); return wr.getContentAsStream(); }
final int colonIndex = value.indexOf(':'); webRequest.setSocksProxy(false); webRequest.setProxyHost(value.substring(0, colonIndex)); webRequest.setProxyPort(Integer.parseInt(value.substring(colonIndex + 1))); final int colonIndex = value.indexOf(':'); webRequest.setSocksProxy(true); webRequest.setProxyHost(value.substring(0, colonIndex)); webRequest.setProxyPort(Integer.parseInt(value.substring(colonIndex + 1))); webRequest.setProxyHost(proxyConfig.getProxyHost()); webRequest.setProxyPort(proxyConfig.getProxyPort()); webRequest.setSocksProxy(proxyConfig.isSocksProxy());
final int colonIndex = value.indexOf(':'); webRequest.setSocksProxy(false); webRequest.setProxyHost(value.substring(0, colonIndex)); webRequest.setProxyPort(Integer.parseInt(value.substring(colonIndex + 1))); final int colonIndex = value.indexOf(':'); webRequest.setSocksProxy(true); webRequest.setProxyHost(value.substring(0, colonIndex)); webRequest.setProxyPort(Integer.parseInt(value.substring(colonIndex + 1))); webRequest.setProxyHost(proxyConfig.getProxyHost()); webRequest.setProxyPort(proxyConfig.getProxyPort()); webRequest.setSocksProxy(proxyConfig.isSocksProxy());