Skip to content

Commit 0d0ea03

Browse files
committed
Add set_proxy_auth to client initialization if proxy auth is required
1 parent da31cd1 commit 0d0ea03

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/telegram/bot/client.rb

+3
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ def error_for_response(response)
5353

5454
def initialize(token = nil, username = nil, **options)
5555
@client = HTTPClient.new
56+
if ENV['HTTP_PROXY']
57+
@client.set_proxy_auth(ENV['HTTP_PROXY_USER'], ENV['HTTP_PROXY_PASSWORD'])
58+
end
5659
@token = token || options[:token]
5760
@username = username || options[:username]
5861
@base_uri = format(URL_TEMPLATE, token: self.token)

0 commit comments

Comments
 (0)