Closed Valiron closed 3 years ago
Have an example of the code you're using and the response?
no_proxy is the default so you shouldn't need to pass that param unless you're needing to deal with a proxy in front of Zabbix
I am also having this isssue
Net::HTTP will automatically create a proxy from the http_proxy environment variable if it is present. To disable use of http_proxy, pass nil for the proxy address.
so it seem that if condition
!ENV['http_proxy'].nil? && options[:no_proxy] != true
evaluates to false you still need to tell Net::HTTP not to use a proxy, so what you really want is
if @proxy_uri
http = Net::HTTP.Proxy(@proxy_host, @proxy_port, @proxy_user, @proxy_pass).new(uri.host, uri.port)
else
http = Net::HTTP.new(uri.host, uri.port, nil)
end
Also as @proxy_uri
is a derived value perhaps you still want :no_proxy
to drive this behavior
When I tried to use the no_proxy option to bypass the proxy, it didn't delivered it correctly. It doesn't appear in the initialize function in the client.rb