mirror of
https://github.com/lostisland/faraday.git
synced 2025-10-05 00:05:35 -04:00
Merge pull request #67 from ezkl/add-http-proxy-to-typhoeus
HTTP proxy support for Typhoeus
This commit is contained in:
commit
9933b8f2d6
@ -29,6 +29,16 @@ module Faraday
|
||||
end
|
||||
|
||||
env_req = env[:request]
|
||||
|
||||
if proxy = env_req[:proxy]
|
||||
req.proxy = "#{proxy[:uri].host}:#{proxy[:uri].port}"
|
||||
|
||||
if proxy[:username] && proxy[:password]
|
||||
req.proxy_username = proxy[:username]
|
||||
req.proxy_password = proxy[:password]
|
||||
end
|
||||
end
|
||||
|
||||
req.timeout = req.connect_timeout = (env_req[:timeout] * 1000) if env_req[:timeout]
|
||||
req.connect_timeout = (env_req[:open_timeout] * 1000) if env_req[:open_timeout]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user