From 95dd4e3a3f460379905381807b35c16cabbe0ccb Mon Sep 17 00:00:00 2001 From: AzZu Date: Sun, 6 May 2018 11:19:53 +0300 Subject: [PATCH] remove http proxy feature Cause apache.http package does not provide socks proxy feature --- .../telegrambots/bots/DefaultBotOptions.java | 18 ------------------ .../facilities/TelegramHttpClientBuilder.java | 13 ------------- 2 files changed, 31 deletions(-) diff --git a/telegrambots/src/main/java/org/telegram/telegrambots/bots/DefaultBotOptions.java b/telegrambots/src/main/java/org/telegram/telegrambots/bots/DefaultBotOptions.java index f965ab91..e2e7d25e 100644 --- a/telegrambots/src/main/java/org/telegram/telegrambots/bots/DefaultBotOptions.java +++ b/telegrambots/src/main/java/org/telegram/telegrambots/bots/DefaultBotOptions.java @@ -23,9 +23,6 @@ public class DefaultBotOptions implements BotOptions { private String baseUrl; private List allowedUpdates; - private CredentialsProvider credentialsProvider; - private HttpHost httpProxy; - public DefaultBotOptions() { maxThreads = 1; baseUrl = ApiConstants.BASE_URL; @@ -88,19 +85,4 @@ public class DefaultBotOptions implements BotOptions { 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; - } } diff --git a/telegrambots/src/main/java/org/telegram/telegrambots/facilities/TelegramHttpClientBuilder.java b/telegrambots/src/main/java/org/telegram/telegrambots/facilities/TelegramHttpClientBuilder.java index fb911c04..57e836a3 100644 --- a/telegrambots/src/main/java/org/telegram/telegrambots/facilities/TelegramHttpClientBuilder.java +++ b/telegrambots/src/main/java/org/telegram/telegrambots/facilities/TelegramHttpClientBuilder.java @@ -18,19 +18,6 @@ public class TelegramHttpClientBuilder { .setSSLHostnameVerifier(new NoopHostnameVerifier()) .setConnectionTimeToLive(70, TimeUnit.SECONDS) .setMaxConnTotal(100); - - if (options.getHttpProxy() != null) { - - httpClientBuilder.setProxy(options.getHttpProxy()); - - if (options.getCredentialsProvider() != null) { - httpClientBuilder - .setProxyAuthenticationStrategy(new ProxyAuthenticationStrategy()) - .setDefaultCredentialsProvider(options.getCredentialsProvider()); - } - - } - return httpClientBuilder.build(); }