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

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

Constant Summary

Constants inherited from Channel::HTTP1

Channel::HTTP1::CRLF

Constants included from Loggable

Loggable::COLORS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ProxyParser

#set_request_headers

Methods inherited from Channel::HTTP1

#<<, #close, #consume, #dispatch, #handle_error, #initialize, #on_body, #on_headers_complete, #on_message_begin, #on_message_complete, #on_trailer_headers_complete, #reenqueue!, #reset, #send

Methods included from Loggable

#log

Methods included from Callbacks

#emit, #on, #once

Constructor Details

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

Instance Attribute Details

#pendingObject (readonly)

Returns the value of attribute pending.



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

def pending
  @pending
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


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

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

#headline_uri(request) ⇒ Object



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

def headline_uri(request)
  return super unless request.verb == :connect
  uri = request.uri
  tunnel = "#{uri.hostname}:#{uri.port}"
  log { "establishing HTTP proxy tunnel to #{tunnel}" }
  tunnel
end