End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
class method
Gem::RemoteFetcher.new
new(proxy=nil, dns=nil, headers={})
lib/rubygems/remote_fetcher.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.2.0/lib/rubygems/remote_fetcher.rb, line 74
def initialize(proxy=nil, dns=nil, headers={})
require_relative "core_ext/tcpsocket_init" if Gem.configuration.ipv4_fallback_enabled
require "net/http"
require "stringio"
require "uri"
Socket.do_not_reverse_lookup = true
@proxy = proxy
@pools = {}
@pool_lock = Thread::Mutex.new
@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.