module HTTPX::Plugins::Proxy::ConnectionMethods

  1. lib/httpx/plugins/proxy.rb

Methods

Public Class

  1. new

Public Instance

  1. call
  2. connecting?
  3. peer

Public Class methods

new(*)
[show source]
    # File lib/httpx/plugins/proxy.rb
274 def initialize(*)
275   super
276   return unless @options.proxy
277 
278   # redefining the connection origin as the proxy's URI,
279   # as this will be used as the tcp peer ip.
280   @proxy_uri = @options.proxy.uri
281 end

Public Instance methods

call()
[show source]
    # File lib/httpx/plugins/proxy.rb
293 def call
294   super
295 
296   return unless @options.proxy
297 
298   case @state
299   when :connecting
300     consume
301   end
302 rescue *PROXY_ERRORS => e
303   if connecting?
304     error = ProxyConnectionError.new(e.message)
305     error.set_backtrace(e.backtrace)
306     raise error
307   end
308 
309   raise e
310 end
connecting?(*args)
[show source]
    # File lib/httpx/plugins/proxy.rb
287 def connecting?(*args)
288   return super unless @options.proxy
289 
290   super || proxy_connecting?(*args)
291 end
peer()
[show source]
    # File lib/httpx/plugins/proxy.rb
283 def peer
284   @proxy_uri || super
285 end