Class: HTTPX::Plugins::Proxy::HTTP::ProxyParser

Inherits:
Connection::HTTP1 show all
Defined in:
lib/httpx/plugins/proxy/http.rb

Direct Known Subclasses

ConnectProxyParser

Constant Summary

Constants inherited from Connection::HTTP1

Connection::HTTP1::CRLF, Connection::HTTP1::MAX_REQUESTS

Constants included from Loggable

Loggable::COLORS

Instance Attribute Summary

Attributes inherited from Connection::HTTP1

#pending

Instance Method Summary collapse

Methods inherited from Connection::HTTP1

#<<, #close, #consume, #dispatch, #empty?, #exhausted?, #handle_error, #initialize, #interests, #on_complete, #on_data, #on_headers, #on_start, #on_trailers, #ping, #reset, #send

Methods included from Loggable

#log, #log_exception

Methods included from Callbacks

#emit, #on, #once

Constructor Details

This class inherits a constructor from HTTPX::Connection::HTTP1

Instance Method Details

#headline_uri(request) ⇒ Object



80
81
82
# File 'lib/httpx/plugins/proxy/http.rb', line 80

def headline_uri(request)
  request.uri.to_s
end

#set_request_headers(request) ⇒ Object



84
85
86
87
88
89
90
# File 'lib/httpx/plugins/proxy/http.rb', line 84

def set_request_headers(request)
  super
  proxy_params = @options.proxy
  request.headers["proxy-authorization"] = "Basic #{proxy_params.token_authentication}" if proxy_params.authenticated?
  request.headers["proxy-connection"] = request.headers["connection"]
  request.headers.delete("connection")
end