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 Attribute Summary
Attributes inherited from Channel
#state, #uri
Instance Method Summary
collapse
Methods inherited from Channel
#addresses=, by, #close, #coalescable?, #interests, #merge, #mergeable?, #unmerge, #upgrade_parser
Methods included from Callbacks
#emit, #on, #once
Methods included from Loggable
#log
Methods included from Registry
extended, included
Constructor Details
#initialize(type, uri, parameters, options, &blk) ⇒ ProxyChannel
Returns a new instance of ProxyChannel.
108
109
110
111
|
# File 'lib/httpx/plugins/proxy.rb', line 108
def initialize(type, uri, parameters, options, &blk)
super(type, uri, options, &blk)
@parameters = parameters
end
|
Instance Method Details
#call ⇒ Object
131
132
133
134
135
136
137
|
# File 'lib/httpx/plugins/proxy.rb', line 131
def call
super
case @state
when :connecting
consume
end
end
|
#match? ⇒ Boolean
113
114
115
|
# File 'lib/httpx/plugins/proxy.rb', line 113
def match?(*)
true
end
|
#reset ⇒ Object
139
140
141
142
143
144
|
# File 'lib/httpx/plugins/proxy.rb', line 139
def reset
@state = :open
transition(:closing)
transition(:closed)
emit(:close)
end
|
#send(request, **args) ⇒ Object
117
118
119
|
# File 'lib/httpx/plugins/proxy.rb', line 117
def send(request, **args)
@pending << [request, args]
end
|
#to_io ⇒ Object
121
122
123
124
125
126
127
128
129
|
# File 'lib/httpx/plugins/proxy.rb', line 121
def to_io
case @state
when :idle
transition(:connecting)
when :connected
transition(:open)
end
@io.to_io
end
|