remove http proxy feature
Cause apache.http package does not provide socks proxy feature
This commit is contained in:
parent
28a9cf1fdb
commit
95dd4e3a3f
@ -23,9 +23,6 @@ public class DefaultBotOptions implements BotOptions {
|
|||||||
private String baseUrl;
|
private String baseUrl;
|
||||||
private List<String> allowedUpdates;
|
private List<String> allowedUpdates;
|
||||||
|
|
||||||
private CredentialsProvider credentialsProvider;
|
|
||||||
private HttpHost httpProxy;
|
|
||||||
|
|
||||||
public DefaultBotOptions() {
|
public DefaultBotOptions() {
|
||||||
maxThreads = 1;
|
maxThreads = 1;
|
||||||
baseUrl = ApiConstants.BASE_URL;
|
baseUrl = ApiConstants.BASE_URL;
|
||||||
@ -88,19 +85,4 @@ public class DefaultBotOptions implements BotOptions {
|
|||||||
this.exponentialBackOff = exponentialBackOff;
|
this.exponentialBackOff = exponentialBackOff;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CredentialsProvider getCredentialsProvider() {
|
|
||||||
return credentialsProvider;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCredentialsProvider(CredentialsProvider credentialsProvider) {
|
|
||||||
this.credentialsProvider = credentialsProvider;
|
|
||||||
}
|
|
||||||
|
|
||||||
public HttpHost getHttpProxy() {
|
|
||||||
return httpProxy;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setHttpProxy(HttpHost httpProxy) {
|
|
||||||
this.httpProxy = httpProxy;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -18,19 +18,6 @@ public class TelegramHttpClientBuilder {
|
|||||||
.setSSLHostnameVerifier(new NoopHostnameVerifier())
|
.setSSLHostnameVerifier(new NoopHostnameVerifier())
|
||||||
.setConnectionTimeToLive(70, TimeUnit.SECONDS)
|
.setConnectionTimeToLive(70, TimeUnit.SECONDS)
|
||||||
.setMaxConnTotal(100);
|
.setMaxConnTotal(100);
|
||||||
|
|
||||||
if (options.getHttpProxy() != null) {
|
|
||||||
|
|
||||||
httpClientBuilder.setProxy(options.getHttpProxy());
|
|
||||||
|
|
||||||
if (options.getCredentialsProvider() != null) {
|
|
||||||
httpClientBuilder
|
|
||||||
.setProxyAuthenticationStrategy(new ProxyAuthenticationStrategy())
|
|
||||||
.setDefaultCredentialsProvider(options.getCredentialsProvider());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return httpClientBuilder.build();
|
return httpClientBuilder.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user