Module: HTTPX::Plugins::Proxy::Socks5::ConnectionMethods

Defined in:
lib/httpx/plugins/proxy/socks5.rb

Instance Method Summary collapse

Instance Method Details

#callObject



22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/httpx/plugins/proxy/socks5.rb', line 22

def call
  super

  return unless @options.proxy && @options.proxy.uri.scheme == "socks5"

  case @state
  when :connecting,
       :negotiating,
       :authenticating
    consume
  end
end

#connecting?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/httpx/plugins/proxy/socks5.rb', line 35

def connecting?
  super || @state == :authenticating || @state == :negotiating
end

#interestsObject



39
40
41
42
43
44
45
# File 'lib/httpx/plugins/proxy/socks5.rb', line 39

def interests
  if @state == :connecting || @state == :authenticating || @state == :negotiating
    return @write_buffer.empty? ? :r : :w
  end

  super
end