Sha256: ca6e62894118c890a554806db587d71283548c4aa5013440898f2d0389c3e167

Contents?: true

Size: 1.66 KB

Versions: 6

Compression:

Stored size: 1.66 KB

Contents

=begin
    Copyright 2010-2015 Tasos Laskos <tasos.laskos@arachni-scanner.com>

    This file is part of the Arachni Framework project and is subject to
    redistribution and commercial restrictions. Please see the Arachni Framework
    web site for more information on licensing and terms of use.
=end

require 'arachni/rpc'
require_relative '../serializer'

module Arachni
module RPC
class Client

# @author Tasos "Zapotek" Laskos <tasos.laskos@arachni-scanner.com>
class Base < Client
    attr_reader :url

    # @param    [Arachni::Options]   options
    #   Relevant options:
    #
    #     * {OptionGroups::RPC#ssl_ca}
    #     * {OptionGroups::RPC#client_ssl_private_key}
    #     * {OptionGroups::RPC#client_ssl_certificate}
    # @param    [String]    url
    #   Server URL in `address:port` format.
    # @param    [String]    token
    #   Optional authentication token.
    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

end
end
end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
arachni-1.3.2 lib/arachni/rpc/client/base.rb
arachni-1.3.1 lib/arachni/rpc/client/base.rb
arachni-1.3 lib/arachni/rpc/client/base.rb
arachni-1.2.1 lib/arachni/rpc/client/base.rb
arachni-1.2 lib/arachni/rpc/client/base.rb
arachni-1.1 lib/arachni/rpc/client/base.rb