class Arachni::RPC::Server::ActiveOptions

It, for the most part, forwards calls to {Arachni::Options} and intercepts a few that need to be updated at other places throughout the framework.

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

Public Class Methods

new( framework ) click to toggle source
# File lib/arachni/rpc/server/active_options.rb, line 20
def initialize( framework )
    @framework = framework
    @options   = framework.options

    (@options.public_methods( false ) - public_methods( false ) ).each do |m|
        self.class.class_eval do
            define_method m do |*args|
                @options.send( m, *args )
            end
        end
    end
end

Public Instance Methods

set( options ) click to toggle source

@see Arachni::Options#set

# File lib/arachni/rpc/server/active_options.rb, line 34
def set( options )
    @options.set( options )

    if @framework.running?

        HTTP::Client.reset_options

        # Scope may have been updated.
        @framework.sitemap.reject! { |k, v| Utilities.skip_path? k }

        @options.scope.extend_paths.each do |url|
            @framework.push_to_url_queue( url )
        end

    # Only mess with HTTP state if this is the pre-run config.
    else
        HTTP::Client.reset false
    end

    true
end
to_h() click to toggle source
# File lib/arachni/rpc/server/active_options.rb, line 56
def to_h
    @options.to_rpc_data
end