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

Inherits:
EM::Client
  • Object
show all
Defined in:
lib/arachni/rpc/client/base.rb

Overview

Author:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Base.

Parameters:

  • opts (Arachni::Options)

    relevant options:

    • ssl_ca – CA file (.pem)

    • node_ssl_pkey OR ssl_pkey – private key file (.pem)

    • node_ssl_cert OR ssl_cert – cert file file (.pem)

  • url (String)

    server URL in <host>:<port> format

  • token (String) (defaults to: nil)

    optional authentication token



38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/arachni/rpc/client/base.rb', line 38

def initialize( opts, url, token = nil )
    @url = url
    host, port = url.split( ':' )
    super(
        host:        host,
        port:        port,
        token:       token,
        max_retries: opts.max_retries,
        ssl_ca:      opts.ssl_ca,
        ssl_pkey:    opts.node_ssl_pkey || opts.ssl_pkey,
        ssl_cert:    opts.node_ssl_cert || opts.ssl_cert
    )
end

Instance Attribute Details

#urlObject (readonly)

Returns the value of attribute url.



28
29
30
# File 'lib/arachni/rpc/client/base.rb', line 28

def url
  @url
end