Class: RubyProxyHeaders::ProxyHeadersConnectionAdapter

Inherits:
HTTParty::ConnectionAdapter
  • Object
show all
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

#connectionObject



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 = options[:proxy_connect_request_headers] || options[:proxy_connect_headers]
    http.proxy_connect_request_headers = h if h&.any?
  end
  http
end