Class: Arachni::RPC::Client::Base

Inherits:
Arachni::RPC::Client show all
Defined in:
lib/arachni/rpc/client/base.rb

Overview

Author:

  • Tasos “Zapotek” Laskos <tasos.laskos@arachni-scanner.com>

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options, url, token = nil) ⇒ Base

Returns a new instance of Base.

Parameters:

  • options (Arachni::Options)

    Relevant options:

    * {OptionGroups::RPC#ssl_ca}
    * {OptionGroups::RPC#client_ssl_private_key}
    * {OptionGroups::RPC#client_ssl_certificate}
    
  • url (String)

    Server URL in `address:port` format.

  • token (String) (defaults to: nil)

    Optional authentication token.



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/arachni/rpc/client/base.rb', line 30

def initialize( options, url, token = nil )
    @url = url

    socket, host, port = nil
    if url.include? ':'
        host, port = url.split( ':' )
    else
        socket = url
    end

    super(
        serializer:           Serializer,
        host:                 host,
        port:                 port.to_i,
        socket:               socket,
        token:                token,
        connection_pool_size: options.rpc.connection_pool_size,
        max_retries:          options.rpc.client_max_retries,
        ssl_ca:               options.rpc.ssl_ca,
        ssl_pkey:             options.rpc.client_ssl_private_key,
        ssl_cert:             options.rpc.client_ssl_certificate
    )
end

Instance Attribute Details

#urlObject (readonly)

Returns the value of attribute url.



18
19
20
# File 'lib/arachni/rpc/client/base.rb', line 18

def url
  @url
end