Class: HTTPX::Plugins::Authentication::Socks5

Inherits:
Object
  • Object
show all
Defined in:
lib/httpx/plugins/auth/socks5.rb,
sig/plugins/auth/socks5.rbs

Instance Method Summary collapse

Instance Method Details

#authenticate ⇒ String

Parameters:

  • (Object)

Returns:

  • (String)


16
17
18
# File 'lib/httpx/plugins/auth/socks5.rb', line 16

def authenticate(*)
  [0x01, @user.bytesize, @user, @password.bytesize, @password].pack("CCA*CA*")
end

#can_authenticate? ⇒ Boolean

Parameters:

  • (Object)

Returns:

  • (Boolean)


12
13
14
# File 'lib/httpx/plugins/auth/socks5.rb', line 12

def can_authenticate?(*)
  @user && @password
end