module Net::HTTP

Public Class Methods

get_env_proxy_settings() click to toggle source
# File core/plugin/proxy/proxy.rb, line 19
def get_env_proxy_settings
  env_proxy_settings = (ENV["HTTP_PROXY"] || '').sub(/http:\/\//, '').split(/[@:]/)
  case(env_proxy_settings.size)
  when 2
    [env_proxy_settings[0], env_proxy_settings[1].to_i]
  when 4
    [env_proxy_settings[2], env_proxy_settings[3].to_i, env_proxy_settings[0], env_proxy_settings[1]]
  else
    [] end end
new(host, port=80, proxy_addr=nil, proxy_port=nil, proxy_user=nil, proxy_pass=nil) click to toggle source
# File core/plugin/proxy/proxy.rb, line 7
def new(host, port=80, proxy_addr=nil, proxy_port=nil, proxy_user=nil, proxy_pass=nil)
  case UserConfig[:proxy_enabled]
  when :specify
    pu, pp = nil, nil
    pu, pp = UserConfig[:proxy_user], UserConfig[:proxy_password] if UserConfig[:proxy_cert]

    new_org(host, port, UserConfig[:proxy_server], UserConfig[:proxy_port].to_i, pu, pp)
  when :disable
    new_org(host, port)
  else
    new_org(host, port, *get_env_proxy_settings) end end
Also aliased as: new_org
new_org(host, port=80, proxy_addr=nil, proxy_port=nil, proxy_user=nil, proxy_pass=nil)
Alias for: new