Skip to content

Commit

Permalink
Add set_proxy_auth to client initialization if proxy auth is required
Browse files Browse the repository at this point in the history
  • Loading branch information
unavailabl3 committed Nov 7, 2019
1 parent da31cd1 commit 0bd8749
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/telegram/bot/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def error_for_response(response)

def initialize(token = nil, username = nil, **options)
@client = HTTPClient.new
@client.set_proxy_auth(ENV['HTTP_PROXY_USER'],ENV['HTTP_PROXY_PASSWORD']) if ENV['HTTP_PROXY']
@token = token || options[:token]
@username = username || options[:username]
@base_uri = format(URL_TEMPLATE, token: self.token)
Expand Down

0 comments on commit 0bd8749

Please sign in to comment.