Class: Faraday::Adapter::NetHttp
- Inherits:
-
Object
- Object
- Faraday::Adapter::NetHttp
- Defined in:
- lib/yodlicious.rb
Instance Method Summary collapse
Instance Method Details
#net_http_connection(env) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/yodlicious.rb', line 14 def net_http_connection(env) if proxy = env[:request][:proxy] if proxy[:socks] # TCPSocket.socks_username = proxy[:user] if proxy[:user] # TCPSocket.socks_password = proxy[:password] if proxy[:password] Net::HTTP::SOCKSProxy(proxy[:uri].host, proxy[:uri].port) else Net::HTTP::Proxy(proxy[:uri].host, proxy[:uri].port, proxy[:uri].user, proxy[:uri].password) end else Net::HTTP end.new(env[:url].host, env[:url].port) end |