From 0fda40c21f520739e206f536f934137608862690 Mon Sep 17 00:00:00 2001 From: Christian-G Date: Wed, 3 Dec 2014 15:52:00 +0100 Subject: [PATCH 1/1] Added HTTP Proxy support --- lib/google/api_client.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/google/api_client.rb b/lib/google/api_client.rb index c79c71b58b..50aeeefe90 100644 --- a/lib/google/api_client.rb +++ b/lib/google/api_client.rb @@ -97,6 +97,9 @@ module Google else logger.warn { "#{self.class} - Please provide :application_name and :application_version when initializing the client" } end + + proxy = options[:proxy] || Object::ENV["http_proxy"] + self.user_agent = options[:user_agent] || ( "#{application_string} " + "google-api-ruby-client/#{Google::APIClient::VERSION::STRING} #{ENV::OS_VERSION} (gzip)" @@ -118,6 +121,7 @@ module Google faraday.options.params_encoder = Faraday::FlatParamsEncoder faraday.ssl.ca_file = ca_file faraday.ssl.verify = true + faraday.proxy proxy faraday.adapter Faraday.default_adapter end return self -- 2.30.2