module HTTPX::Plugins::Proxy::ConnectionMethods

  1. lib/httpx/plugins/proxy.rb

Methods

Public Class

  1. new

Public Instance

  1. call
  2. connecting?
  3. peer
  4. reset

Public Class methods

new(*)
[show source]
    # File lib/httpx/plugins/proxy.rb
226 def initialize(*)
227   super
228   return unless @options.proxy
229 
230   # redefining the connection origin as the proxy's URI,
231   # as this will be used as the tcp peer ip.
232   @proxy_uri = URI(@options.proxy.uri)
233 end

Public Instance methods

call()
[show source]
    # File lib/httpx/plugins/proxy.rb
245 def call
246   super
247 
248   return unless @options.proxy
249 
250   case @state
251   when :connecting
252     consume
253   end
254 end
connecting?()
[show source]
    # File lib/httpx/plugins/proxy.rb
239 def connecting?
240   return super unless @options.proxy
241 
242   super || @state == :connecting || @state == :connected
243 end
peer()
[show source]
    # File lib/httpx/plugins/proxy.rb
235 def peer
236   @proxy_uri || super
237 end
reset()
[show source]
    # File lib/httpx/plugins/proxy.rb
256 def reset
257   return super unless @options.proxy
258 
259   @state = :open
260 
261   super
262   # emit(:close)
263 end