Skip to content

Commit

Permalink
Merge pull request #380 from dexhorthy/net-http-proxy
Browse files Browse the repository at this point in the history
Fixes #371 allow transparent proxy config in `Net::HTTP` via ENV
  • Loading branch information
Cawllec authored Nov 2, 2017
2 parents ac5d6dd + 5625096 commit b19a91a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/bugsnag/delivery/synchronous.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ def deliver(url, body, configuration)

def request(url, body, configuration)
uri = URI.parse(url)
http = Net::HTTP.new(uri.host, uri.port, configuration.proxy_host, configuration.proxy_port, configuration.proxy_user, configuration.proxy_password)

if configuration.proxy_host
http = Net::HTTP.new(uri.host, uri.port, configuration.proxy_host, configuration.proxy_port, configuration.proxy_user, configuration.proxy_password)
else
http = Net::HTTP.new(uri.host, uri.port)
end

http.read_timeout = configuration.timeout
http.open_timeout = configuration.timeout

Expand All @@ -48,4 +54,4 @@ def path(uri)
end
end

Bugsnag::Delivery.register(:synchronous, Bugsnag::Delivery::Synchronous)
Bugsnag::Delivery.register(:synchronous, Bugsnag::Delivery::Synchronous)

0 comments on commit b19a91a

Please sign in to comment.