Module: RubyProxyHeaders::NetHTTP
- Defined in:
- lib/ruby_proxy_headers/net_http.rb
Overview
Patches Net::HTTP#connect for HTTPS-over-proxy so extra headers can be sent on the CONNECT request and response headers can be read (e.g. ProxyMesh X-ProxyMesh-IP). Based on the same tunnel flow as Python's http.client / urllib3 extensions in python-proxy-headers.
Defined Under Namespace
Modules: Extension
Constant Summary collapse
- ORIGINAL_CONNECT =
::Net::HTTP.instance_method(:connect)
Class Method Summary collapse
Class Method Details
.patch! ⇒ Object
160 161 162 163 164 165 |
# File 'lib/ruby_proxy_headers/net_http.rb', line 160 def patch! return if @patched ::Net::HTTP.prepend(Extension) @patched = true end |
.patched? ⇒ Boolean
167 168 169 |
# File 'lib/ruby_proxy_headers/net_http.rb', line 167 def patched? @patched == true end |