Class: HTTPX::Plugins::Proxy::HTTP::ConnectProxyParser

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

Constant Summary

Constants inherited from Connection::HTTP1

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

Constants included from Loggable

Loggable::COLORS

Instance Attribute Summary collapse

Attributes inherited from Connection::HTTP1

#requests

Instance Method Summary collapse

Methods inherited from ProxyParser

#set_protocol_headers

Methods inherited from Connection::HTTP1

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

Methods included from Loggable

#log, #log_exception

Methods included from Callbacks

#emit, #on, #once, #only

Constructor Details

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

Instance Attribute Details

#pendingObject (readonly)

Returns the value of attribute pending.



95
96
97
# File 'lib/httpx/plugins/proxy/http.rb', line 95

def pending
  @pending
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


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

def empty?
  @requests.reject { |r| r.verb == :connect }.empty? || @requests.all? { |request| !request.response.nil? }
end

#headline_uri(request) ⇒ Object



97
98
99
100
101
102
103
# File 'lib/httpx/plugins/proxy/http.rb', line 97

def headline_uri(request)
  return super unless request.verb == :connect

  tunnel = request.path
  log { "establishing HTTP proxy tunnel to #{tunnel}" }
  tunnel
end