class method
Gem::RemoteFetcher.new
new(proxy = nil, dns = nil, headers = {})
lib/rubygems/remote_fetcher.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/rubygems/remote_fetcher.rb, line 75
def initialize(proxy = nil, dns = nil, headers = {})
require_relative "core_ext/tcpsocket_init" if Gem.configuration.ipv4_fallback_enabled
require_relative "vendored_net_http"
require_relative "vendor/uri/lib/uri"
Socket.do_not_reverse_lookup = true
@proxy = proxy
@pools = {}
@pool_lock = Thread::Mutex.new
@pool_size = 1
@cert_files = Gem::Request.get_cert_files
@headers = headers
end
Initialize a remote fetcher using the source URI and possible proxy information.
proxy
-
[String]: explicit specification of proxy; overrides any environment
Examplevariable setting
-
nil: respect environment variables (HTTP_PROXY, HTTP_PROXY_USER,
HTTP_PROXY_PASS)
-
:no_proxy: ignore environment variables and _don’t_ use a proxy
headers: A set of additional HTTP headers to be sent to the server when
fetching the gem.