hoodoo icon indicating copy to clipboard operation
hoodoo copied to clipboard

Review HTTP(S) proxy situation for Client

Open pond opened this issue 8 years ago • 0 comments

Older code using an HTTP(S) proxy has to do stuff like this to instantiate a Hoodoo::Client:

options = {
  :base_uri => SomeName::Application.config.x.platform_api_endpoint,
  # ...other things...
}

unless Rails.env.test?
  options[ :discoverer ] = Hoodoo::Services::Discovery::ByConvention.new( {
    :base_uri  => SomeName::Application.config.x.platform_api_endpoint,
    :proxy_uri => ENV[ 'https_proxy' ]
  } )
end

return Hoodoo::Client.new( options )

Can that be automated? Doesn't Net::HTTP self-configure?

pond avatar Mar 23 '17 20:03 pond