Method: Net::HTTP.Proxy
- Defined in:
- lib/net/http.rb
.Proxy(p_addr = :ENV, p_port = nil, p_user = nil, p_pass = nil) ⇒ Object
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.
972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 |
# File 'lib/net/http.rb', line 972 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 |