From d9404d4701427d26f6cfe0c6c784a263df9cba2f Mon Sep 17 00:00:00 2001 From: David Cramer Date: Tue, 6 Jan 2015 14:12:25 -0800 Subject: [PATCH] Add proxy support --- lib/raven/configuration.rb | 6 +++++- lib/raven/transports/http.rb | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/raven/configuration.rb b/lib/raven/configuration.rb index ea344090b..01fb3d065 100644 --- a/lib/raven/configuration.rb +++ b/lib/raven/configuration.rb @@ -55,9 +55,12 @@ class Configuration # Should the SSL certificate of the server be verified? attr_accessor :ssl_verification - # Ssl settings passed direactly to faraday's ssl option + # SSl settings passed direactly to faraday's ssl option attr_accessor :ssl + # Proxy information to pass to the HTTP adapter + attr_accessor :proxy + attr_reader :current_environment # The Faraday adapter to be used. Will default to Net::HTTP when not set. @@ -106,6 +109,7 @@ def initialize self.encoding = 'gzip' self.timeout = 1 self.open_timeout = 1 + self.proxy = nil self.tags = {} self.async = false self.catch_debugged_exceptions = true diff --git a/lib/raven/transports/http.rb b/lib/raven/transports/http.rb index be3cb7783..922b86720 100644 --- a/lib/raven/transports/http.rb +++ b/lib/raven/transports/http.rb @@ -37,6 +37,10 @@ def conn builder.adapter(*adapter) end + if self.configuration.proxy + conn.options[:proxy] = self.configuration.proxy + end + if self.configuration.timeout conn.options[:timeout] = self.configuration.timeout end