private void configureHost(final Config config, HttpClient client) { HostConfiguration hostConfiguration = client.getHostConfiguration(); String proxyHost = config.get("http.proxy.host"); if (proxyHost != null) { int proxyPort = config.getAsInteger("http.proxy.port", DEFAULT_PROXY_PORT); hostConfiguration.setProxy(proxyHost, proxyPort); } HostParams hostParams = new HostParams(); hostConfiguration.setParams(hostParams); }