module HTTPX::Plugins::Proxy::HTTP::ProxyParser

  1. lib/httpx/plugins/proxy/http.rb

Methods

Public Instance

  1. join_headline
  2. set_protocol_headers

Public Instance methods

join_headline(request)
[show source]
    # File lib/httpx/plugins/proxy/http.rb
149 def join_headline(request)
150   return super if request.verb == "CONNECT"
151 
152   "#{request.verb} #{request.uri} HTTP/#{@version.join(".")}"
153 end
set_protocol_headers(request)
[show source]
    # File lib/httpx/plugins/proxy/http.rb
155 def set_protocol_headers(request)
156   extra_headers = super
157 
158   proxy_params = @options.proxy
159   if proxy_params.scheme == "basic"
160     # opt for basic auth
161     extra_headers["proxy-authorization"] = proxy_params.authenticate(extra_headers)
162   end
163   extra_headers["proxy-connection"] = extra_headers.delete("connection") if extra_headers.key?("connection")
164   extra_headers
165 end