Class: HTTPX::ProxyChannel
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, #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.
105
106
107
108
|
# File 'lib/httpx/plugins/proxy.rb', line 105
def initialize(io, parameters, options, &blk)
super(io, options, &blk)
@parameters = parameters
end
|
Instance Method Details
#call ⇒ Object
128
129
130
131
132
133
134
|
# File 'lib/httpx/plugins/proxy.rb', line 128
def call
super
case @state
when :connecting
consume
end
end
|
#match? ⇒ Boolean
110
111
112
|
# File 'lib/httpx/plugins/proxy.rb', line 110
def match?(*)
true
end
|
#reset ⇒ Object
136
137
138
139
140
141
|
# File 'lib/httpx/plugins/proxy.rb', line 136
def reset
@state = :open
transition(:closing)
transition(:closed)
emit(:close)
end
|
#send(request, **args) ⇒ Object
114
115
116
|
# File 'lib/httpx/plugins/proxy.rb', line 114
def send(request, **args)
@pending << [request, args]
end
|
#to_io ⇒ Object
118
119
120
121
122
123
124
125
126
|
# File 'lib/httpx/plugins/proxy.rb', line 118
def to_io
case @state
when :idle
transition(:connecting)
when :connected
transition(:open)
end
@io.to_io
end
|