Added HTTP Proxy support

This commit is contained in:
Christian-G 2014-12-03 15:52:00 +01:00
parent c6eb3920ad
commit 0fda40c21f
1 changed files with 4 additions and 0 deletions

View File

@ -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