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 ‘address:port` format.

  • token (String) (defaults to: nil)

    Optional authentication token.



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/arachni/rpc/client/base.rb', line 39

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

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

    super(
        serializer:  Marshal,
        host:        host,
        port:        port,
        socket:      socket,
        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.



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

def url
  @url
end