Class: HTTPX::Plugins::Proxy::HTTP::ConnectRequest

Inherits:
Request
  • Object
show all
Defined in:
lib/httpx/plugins/proxy/http.rb

Constant Summary

Constants inherited from Request

Request::METHODS, Request::USER_AGENT

Instance Attribute Summary

Attributes inherited from Request

#body, #headers, #options, #response, #state, #timer, #uri, #verb

Instance Method Summary collapse

Methods inherited from Request

#authority, #drain_body, #expects?, #inspect, #merge_headers, #origin, #query, #scheme, #transition

Methods included from Callbacks

#emit, #on, #once

Constructor Details

#initialize(uri, options) ⇒ ConnectRequest

Returns a new instance of ConnectRequest.



105
106
107
108
109
110
# File 'lib/httpx/plugins/proxy/http.rb', line 105

def initialize(uri, options)
  super(:connect, uri, {})
  proxy_params = options.proxy
  @headers["proxy-authentication"] = "Basic #{proxy_params.token_authentication}" if proxy_params.authenticated?
  @headers.delete("accept")
end

Instance Method Details

#pathObject



112
113
114
# File 'lib/httpx/plugins/proxy/http.rb', line 112

def path
  "#{@uri.hostname}:#{@uri.port}"
end