use of org.apache.drill.exec.store.http.util.HttpProxyConfig.ProxyBuilder in project drill by apache.
the class HttpBatchReader method proxySettings.
protected HttpProxyConfig proxySettings(Config drillConfig, HttpUrl url) {
final HttpStoragePluginConfig config = subScan.tableSpec().config();
final ProxyBuilder builder = HttpProxyConfig.builder().fromConfigForURL(drillConfig, url.toString());
final String proxyType = config.proxyType();
if (proxyType != null && !"direct".equals(proxyType)) {
UsernamePasswordCredentials credentials = config.getUsernamePasswordCredentials();
builder.type(config.proxyType()).host(config.proxyHost()).port(config.proxyPort()).username(credentials.getUsername()).password(credentials.getPassword());
}
return builder.build();
}
Aggregations