Proxy(p_addr = :ENV, p_port = nil, p_user = nil, p_pass = nil)
public
Creates an HTTP proxy class which behaves like Net::HTTP, but performs all access via the
specified proxy.
This class is obsolete. You may pass these same parameters directly to
Net::HTTP.new. See Net::HTTP.new for details of the arguments.
Show source
def HTTP.Proxy(p_addr = :ENV, p_port = nil, p_user = nil, p_pass = nil)
return self unless p_addr
Class.new(self) {
@is_proxy_class = true
if p_addr == :ENV then
@proxy_from_env = true
@proxy_address = nil
@proxy_port = nil
else
@proxy_from_env = false
@proxy_address = p_addr
@proxy_port = p_port || default_port
end
@proxy_user = p_user
@proxy_pass = p_pass
}
end