class HTTPX::Plugins::Authentication::Socks5

  1. lib/httpx/plugins/auth/socks5.rb
Superclass: Object

Methods

Public Class

  1. new

Public Instance

  1. authenticate
  2. can_authenticate?

Public Class methods

new(user, password, **)
[show source]
   # File lib/httpx/plugins/auth/socks5.rb
 7 def initialize(user, password, **)
 8   @user = user
 9   @password = password
10 end

Public Instance methods

authenticate(*)
[show source]
   # File lib/httpx/plugins/auth/socks5.rb
16 def authenticate(*)
17   [0x01, @user.bytesize, @user, @password.bytesize, @password].pack("CCA*CA*")
18 end
can_authenticate?(*)
[show source]
   # File lib/httpx/plugins/auth/socks5.rb
12 def can_authenticate?(*)
13   @user && @password
14 end