Module: HTTPX::Plugins::Proxy

Defined in:
lib/httpx/plugins/proxy.rb,
lib/httpx/plugins/proxy/ssh.rb,
lib/httpx/plugins/proxy/http.rb,
lib/httpx/plugins/proxy/socks4.rb,
lib/httpx/plugins/proxy/socks5.rb

Overview

This plugin adds support for proxies. It ships with support for:

  • HTTP proxies

  • HTTPS proxies

  • Socks4/4a proxies

  • Socks5 proxies

gitlab.com/honeyryderchuck/httpx/wikis/Proxy

Defined Under Namespace

Modules: ConnectionMethods, HTTP, InstanceMethods, SSH, Socks4, Socks5 Classes: Parameters

Constant Summary collapse

Error =
Class.new(Error)
PROXY_ERRORS =
[TimeoutError, IOError, SystemCallError, Error].freeze

Class Method Summary collapse

Class Method Details

.configure(klass) ⇒ Object



52
53
54
55
56
# File 'lib/httpx/plugins/proxy.rb', line 52

def configure(klass)
  klass.plugin(:"proxy/http")
  klass.plugin(:"proxy/socks4")
  klass.plugin(:"proxy/socks5")
end

.extra_options(options) ⇒ Object



58
59
60
61
62
63
64
# File 'lib/httpx/plugins/proxy.rb', line 58

def extra_options(options)
  Class.new(options.class) do
    def_option(:proxy) do |pr|
      Hash[pr]
    end
  end.new(options)
end