Class: FinalDestination::FaradayAdapter
- Inherits:
-
Faraday::Adapter::NetHttp
- Object
- Faraday::Adapter::NetHttp
- FinalDestination::FaradayAdapter
- Defined in:
- lib/final_destination/faraday_adapter.rb
Instance Method Summary collapse
Instance Method Details
#net_http_connection(env) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/final_destination/faraday_adapter.rb', line 5 def net_http_connection(env) proxy = env[:request][:proxy] port = env[:url].port || (env[:url].scheme == "https" ? 443 : 80) if proxy FinalDestination::HTTP.new( env[:url].hostname, port, proxy[:uri].hostname, proxy[:uri].port, proxy[:user], proxy[:password], ) else FinalDestination::HTTP.new(env[:url].hostname, port, nil) end end |