Module: Typhoeus::EasyFu::Proxy
- Included in:
- Typhoeus::Easy
- Defined in:
- lib/typhoeus/easy/proxy.rb
Instance Method Summary collapse
Instance Method Details
#proxy=(proxy) ⇒ Object
4 5 6 7 |
# File 'lib/typhoeus/easy/proxy.rb', line 4 def proxy=(proxy) set_option(:proxy, proxy[:server]) set_option(:proxytype, Typhoeus::Easy::PROXY_TYPES[proxy[:type]]) if proxy[:type] end |
#proxy_auth=(authinfo) ⇒ Object
9 10 11 12 |
# File 'lib/typhoeus/easy/proxy.rb', line 9 def proxy_auth=(authinfo) set_option(:proxyuserpwd, proxy_credentials(authinfo)) set_option(:proxyauth, Typhoeus::Easy::PROXY_TYPES[proxy[:type]]) if authinfo[:method] end |
#proxy_credentials(authinfo) ⇒ Object
14 15 16 |
# File 'lib/typhoeus/easy/proxy.rb', line 14 def proxy_credentials(authinfo) "#{authinfo[:username]}:#{authinfo[:password]}" end |