Class: Arachni::RPC::Server::ActiveOptions
- Defined in:
- lib/arachni/rpc/server/active_options.rb
Overview
It, for the most part, forwards calls to Options and intercepts a few that need to be updated at other places throughout the framework.
Instance Method Summary collapse
- #cookie_jar=(cookie_jar) ⇒ Object
-
#initialize(framework) ⇒ ActiveOptions
constructor
A new instance of ActiveOptions.
- #proxy=(proxy_url) ⇒ Object
- #set(options) ⇒ Object
Constructor Details
#initialize(framework) ⇒ ActiveOptions
Returns a new instance of ActiveOptions.
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/arachni/rpc/server/active_options.rb', line 29 def initialize( framework ) @opts = framework.opts %w( url http_req_limit http_timeout user_agent redirect_limit proxy_username proxy_password proxy_type proxy_host proxy_port authed_by cookies cookie_string http_username http_password ).each do |m| m = "#{m}=".to_sym self.class.class_eval do define_method m do |v| @opts.send( m, v ) HTTP.reset false v end end end (@opts.public_methods( false ) - public_methods( false ) ).each do |m| self.class.class_eval do define_method m do |*args| @opts.send( m, *args ) end end end end |
Instance Method Details
#cookie_jar=(cookie_jar) ⇒ Object
78 79 80 81 |
# File 'lib/arachni/rpc/server/active_options.rb', line 78 def ( ) HTTP.( ) = end |
#proxy=(proxy_url) ⇒ Object
70 71 72 73 74 75 76 |
# File 'lib/arachni/rpc/server/active_options.rb', line 70 def proxy=( proxy_url ) @opts.proxy_host, @opts.proxy_port = proxy_url.to_s.split( /:/ ) @opts.proxy_port = @opts.proxy_port.to_i HTTP.reset false @opts.proxy = proxy_url end |
#set(options) ⇒ Object
56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/arachni/rpc/server/active_options.rb', line 56 def set( ) .each do |k, v| begin send( "#{k.to_s}=", v ) rescue => e #ap e #ap e.backtrace end end HTTP.reset false true end |