diff --git a/Gemfile.lock b/Gemfile.lock index 7d2ee82..768996a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -12,7 +12,7 @@ GIT PATH remote: . specs: - stealth-bandwidth (2.0.0) + stealth-bandwidth (2.0.1) http (~> 4.1) oj (~> 3.11) stealth (>= 3.0.0.alpha1) diff --git a/VERSION b/VERSION index 227cea2..38f77a6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.0.0 +2.0.1 diff --git a/lib/stealth/services/bandwidth/client.rb b/lib/stealth/services/bandwidth/client.rb index e45439e..5eca33e 100644 --- a/lib/stealth/services/bandwidth/client.rb +++ b/lib/stealth/services/bandwidth/client.rb @@ -24,6 +24,14 @@ def initialize(reply:, **args) .timeout(connect: 15, read: 30) .basic_auth(user: username, pass: password) .headers('Content-Type' => 'application/json; charset=utf-8') + # Set up proxy if one is configured + if proxy = URI(@endpoint).find_proxy + if proxy.user || proxy.password + @http_client = @http_client.via(proxy.host, proxy.port, proxy.user, proxy.password) + else + @http_client = @http_client.via(proxy.host, proxy.port) + end + end end def transmit