Sha256: 47bb7f4583b0b1ff1a8985ae165460c14cae5efd1e0ffaaf65ffa775aa08beaa

Contents?: true

Size: 446 Bytes

Versions: 20

Compression:

Stored size: 446 Bytes

Contents

# frozen_string_literal: true

module HTTPX
  module Plugins
    module Authentication
      class Socks5
        def initialize(user, password, **)
          @user = user
          @password = password
        end

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

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

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
httpx-1.3.4 lib/httpx/plugins/auth/socks5.rb
httpx-1.3.3 lib/httpx/plugins/auth/socks5.rb
httpx-1.3.2 lib/httpx/plugins/auth/socks5.rb
httpx-1.3.1 lib/httpx/plugins/auth/socks5.rb
httpx-1.3.0 lib/httpx/plugins/auth/socks5.rb
httpx-1.2.6 lib/httpx/plugins/auth/socks5.rb
httpx-1.2.4 lib/httpx/plugins/auth/socks5.rb
httpx-1.2.3 lib/httpx/plugins/auth/socks5.rb
httpx-1.2.2 lib/httpx/plugins/auth/socks5.rb
httpx-1.2.1 lib/httpx/plugins/auth/socks5.rb
httpx-1.2.0 lib/httpx/plugins/auth/socks5.rb
httpx-1.1.5 lib/httpx/plugins/auth/socks5.rb
httpx-1.1.4 lib/httpx/plugins/auth/socks5.rb
httpx-1.1.3 lib/httpx/plugins/auth/socks5.rb
httpx-1.1.2 lib/httpx/plugins/auth/socks5.rb
httpx-1.1.1 lib/httpx/plugins/auth/socks5.rb
httpx-1.1.0 lib/httpx/plugins/auth/socks5.rb
httpx-1.0.2 lib/httpx/plugins/auth/socks5.rb
httpx-1.0.1 lib/httpx/plugins/auth/socks5.rb
httpx-1.0.0 lib/httpx/plugins/auth/socks5.rb