# File raggle, line 677 def Proxy::find_proxy(host) ret = nil # if we're in windows, check the registry as well ret = Proxy::find_win32_proxy if RUBY_PLATFORM =~ /win32/ # get proxy settings from $config, and if they're not there, then # check ENV if $config['proxy'] && $config['proxy']['host'] ret = $config['proxy'] elsif ENV['http_proxy'] && ENV['http_proxy'] =~ /http:\/\/([^:]+):(\d+)/ ret = { 'host' => $1, 'port' => $2 } no_proxy = ENV['no_proxy'] ret['no_proxy'] = (no_proxy ? no_proxy.split(/\s*,\s*/) : []) end # return nil if host is in no_proxy list ret = nil if ret && ret['no_proxy'] && ret['no_proxy'].find { |i| /#{i}/ =~ host } ret end