Class: HTTPX::ProxyChannel

Inherits:
Channel
  • Object
show all
Defined in:
lib/httpx/plugins/proxy.rb

Constant Summary

Constants inherited from Channel

Channel::BUFFER_SIZE

Constants included from Loggable

Loggable::COLORS

Constants included from Registry

Registry::Error

Instance Method Summary collapse

Methods inherited from Channel

by, #close, #interests, #reset, #send, #upgrade_parser

Methods included from Callbacks

#emit, #on, #once

Methods included from Loggable

#log

Methods included from Registry

extended, included

Constructor Details

#initialize(io, parameters, options, &blk) ⇒ ProxyChannel

Returns a new instance of ProxyChannel.



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

def initialize(io, parameters, options, &blk)
  super(io, options, &blk)
  @parameters = parameters
end

Instance Method Details

#callObject



104
105
106
107
108
109
110
# File 'lib/httpx/plugins/proxy.rb', line 104

def call
  super
  case @state
  when :connecting
    consume
  end
end

#match?Boolean

Returns:

  • (Boolean)


90
91
92
# File 'lib/httpx/plugins/proxy.rb', line 90

def match?(*)
  true
end

#to_ioObject



94
95
96
97
98
99
100
101
102
# File 'lib/httpx/plugins/proxy.rb', line 94

def to_io
  case @state
  when :idle
    transition(:connecting)
  when :connected
    transition(:open)
  end
  @io.to_io
end