Sha256: 25e32c693ae2524d7f1539e12835ff87efc14a6c91785347f5418df54990c848

Contents?: true

Size: 1.66 KB

Versions: 7

Compression:

Stored size: 1.66 KB

Contents

=begin
    Copyright 2010-2014 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

7 entries across 7 versions & 1 rubygems

Version Path
arachni-1.0.6 lib/arachni/rpc/client/base.rb
arachni-1.0.5 lib/arachni/rpc/client/base.rb
arachni-1.0.4 lib/arachni/rpc/client/base.rb
arachni-1.0.3 lib/arachni/rpc/client/base.rb
arachni-1.0.2 lib/arachni/rpc/client/base.rb
arachni-1.0.1 lib/arachni/rpc/client/base.rb
arachni-1.0 lib/arachni/rpc/client/base.rb