Class: Arachni::Rest::Server
- Extended by:
- UI::Output
- Defined in:
- lib/arachni/rest/server.rb,
lib/arachni/rest/server/instance_helpers.rb more...
Defined Under Namespace
Modules: InstanceHelpers
Constant Summary collapse
- VALID_REPORT_FORMATS =
%w(json xml yaml html.zip)
Class Method Summary collapse
Methods included from UI::Output
debug?, debug_level_1?, debug_level_2?, debug_level_3?, debug_level_4?, debug_off, debug_on, disable_only_positives, included, mute, muted?, only_positives, only_positives?, print_bad, print_debug, print_debug_backtrace, print_debug_level_1, print_debug_level_2, print_debug_level_3, print_debug_level_4, print_error, print_error_backtrace, print_exception, print_info, print_line, print_ok, print_status, print_verbose, reroute_to_file, reroute_to_file?, reset_output_options, unmute, verbose?, verbose_on
Class Method Details
.run!(options) ⇒ Object
[View source]
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 |
# File 'lib/arachni/rest/server.rb', line 198 def run!( ) set :username, [:username] set :password, [:password] server = Puma::Server.new( self ) server.min_threads = 0 server.max_threads = 16 ssl = false if [:ssl_key] && [:ssl_certificate] ctx = Puma::MiniSSL::Context.new ctx.key = [:ssl_key] ctx.cert = [:ssl_certificate] if [:ssl_ca] print_info 'CA provided, peer verification has been enabled.' ctx.ca = [:ssl_ca] ctx.verify_mode = Puma::MiniSSL::VERIFY_PEER | Puma::MiniSSL::VERIFY_FAIL_IF_NO_PEER_CERT else print_info 'CA missing, peer verification has been disabled.' end ssl = true server.binder.add_ssl_listener( [:bind], [:port], ctx ) else ssl = false server.add_tcp_listener( [:bind], [:port] ) end print_status "Listening on http#{'s' if ssl}://#{[:bind]}:#{[:port]}" begin server.run.join rescue Interrupt server.stop( true ) end end |