protectedlobster.rb 373 B

1234567891011121314
  1. require 'rack'
  2. require 'rack/lobster'
  3. lobster = Rack::Lobster.new
  4. protected_lobster = Rack::Auth::Basic.new(lobster) do |username, password|
  5. 'secret' == password
  6. end
  7. protected_lobster.realm = 'Lobster 2.0'
  8. pretty_protected_lobster = Rack::ShowStatus.new(Rack::ShowExceptions.new(protected_lobster))
  9. Rack::Handler::WEBrick.run pretty_protected_lobster, :Port => 9292