Skip to content

Commit

Permalink
http_proxy support
Browse files Browse the repository at this point in the history
  • Loading branch information
vadv committed Nov 8, 2012
1 parent 00ab11b commit ae8c338
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/zabbixapi/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ def initialize (api_url, api_user, api_password)

@debug = false # Disable debug by default
@basic_auth = false #Disable basic_auth by default
if ENV['http_proxy'].nil?

unless ENV['http_proxy'].nil?
@proxy_uri = URI.parse(ENV['http_proxy'])
@proxy_host = proxy_uri.host
@proxy_port = proxy_uri.port
Expand All @@ -55,7 +55,7 @@ def do_request(message)
if @proxy_uri.nil?
http = Net::HTTP.new(uri.host, uri.port)
else
http = Net::HTTP.new(uri.host, uri.port, @proxy_host, @proxy_port, @proxy_user, @proxy_pass)
http = Net::HTTP.Proxy(@proxy_host, @proxy_port, @proxy_user, @proxy_pass).new(uri.host, uri.port)
end

if uri.scheme == "https"
Expand Down
2 changes: 1 addition & 1 deletion zabbixapi.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ require 'rake'

Gem::Specification.new do |spec|

spec.version = '0.1.8'
spec.version = '0.1.9'
spec.name = 'zabbixapi'
spec.summary = 'Ruby module for work with zabbix api.'

Expand Down

0 comments on commit ae8c338

Please sign in to comment.