Class: Arachni::RPC::XML::Server::Base
- Defined in:
- lib/rpc/xml/server/base.rb
Overview
Dispatcher class
@author: Tasos “Zapotek” Laskos
<[email protected]>
<[email protected]>
@version: 0.1
Direct Known Subclasses
Instance Method Summary collapse
- #add_handler(name, klass) ⇒ Object
- #alive? ⇒ Boolean (also: #is_alive)
-
#initialize(opts) ⇒ Base
constructor
A new instance of Base.
- #run ⇒ Object
- #shutdown ⇒ Object
Constructor Details
#initialize(opts) ⇒ Base
Returns a new instance of Base.
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 54 |
# File 'lib/rpc/xml/server/base.rb', line 29 def initialize( opts ) pkey = ::OpenSSL::PKey::RSA.new( File.read( opts.ssl_pkey ) ) if opts.ssl_pkey cert = ::OpenSSL::X509::Certificate.new( File.read( opts.ssl_cert ) ) if opts.ssl_cert if opts.ssl_pkey || opts.ssl_cert || opts.ssl_ca verification = OpenSSL::SSL::VERIFY_PEER | OpenSSL::SSL::VERIFY_FAIL_IF_NO_PEER_CERT else verification = ::OpenSSL::SSL::VERIFY_NONE end @server = ::WEBrick::HTTPServer.new( :Port => opts.rpc_port, :SSLEnable => opts.ssl || false, :SSLVerifyClient => verification, :SSLCertName => [ [ "CN", ::WEBrick::Utils::getservername ] ], :SSLCertificate => cert, :SSLPrivateKey => pkey, :SSLCACertificateFile => opts.ssl_ca ) print_status( 'Initing XMLRPC Server...' ) @service = ::XMLRPC::WEBrickServlet.new( ) @service.add_introspection @server.mount( "/RPC2", @service ) end |
Instance Method Details
#add_handler(name, klass) ⇒ Object
56 57 58 |
# File 'lib/rpc/xml/server/base.rb', line 56 def add_handler( name, klass ) @service.add_handler( ::XMLRPC::iPIMethods( name ), klass ) end |
#alive? ⇒ Boolean Also known as: is_alive
64 65 66 |
# File 'lib/rpc/xml/server/base.rb', line 64 def alive? return true end |
#run ⇒ Object
60 61 62 |
# File 'lib/rpc/xml/server/base.rb', line 60 def run @server.start end |
#shutdown ⇒ Object
69 70 71 |
# File 'lib/rpc/xml/server/base.rb', line 69 def shutdown @server.shutdown end |