Public Class methods
new(*)
[show source]
# File lib/httpx/plugins/proxy.rb 246 def initialize(*) 247 super 248 return unless @options.proxy 249 250 # redefining the connection origin as the proxy's URI, 251 # as this will be used as the tcp peer ip. 252 @proxy_uri = URI(@options.proxy.uri) 253 end
Public Instance methods
call()
[show source]
# File lib/httpx/plugins/proxy.rb 265 def call 266 super 267 268 return unless @options.proxy 269 270 case @state 271 when :connecting 272 consume 273 end 274 rescue *PROXY_ERRORS => e 275 if connecting? 276 error = ProxyConnectionError.new(e.message) 277 error.set_backtrace(e.backtrace) 278 raise error 279 end 280 281 raise e 282 end
connecting?()
[show source]
# File lib/httpx/plugins/proxy.rb 259 def connecting? 260 return super unless @options.proxy 261 262 super || @state == :connecting || @state == :connected 263 end
reset()
[show source]
# File lib/httpx/plugins/proxy.rb 284 def reset 285 return super unless @options.proxy 286 287 @state = :open 288 289 super 290 # emit(:close) 291 end