Class: RubyProxyHeaders::ProxyHeadersConnectionAdapter
- Inherits:
-
HTTParty::ConnectionAdapter
- Object
- HTTParty::ConnectionAdapter
- RubyProxyHeaders::ProxyHeadersConnectionAdapter
- Defined in:
- lib/ruby_proxy_headers/httparty.rb
Overview
Drop-in connection adapter: pass +:proxy_connect_request_headers+ in options (along with +http_proxyaddr+ / +http_proxyport+ / etc.).
After the request, read CONNECT response headers via proxy_connect_response_headers (thread-local).
Instance Method Summary collapse
Instance Method Details
#connection ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/ruby_proxy_headers/httparty.rb', line 18 def connection http = super if http.respond_to?(:proxy_connect_request_headers=) h = [:proxy_connect_request_headers] || [:proxy_connect_headers] http.proxy_connect_request_headers = h if h&.any? end http end |