WEBrick で Basic 認証を行う - elm200 の日記(旧はてなダイアリー)

趣旨 WEBrick で Basic 認証を行ってみる。 #!/usr/local/bin/ruby require 'webrick' include WEBrick mime_types = HTTPUtils::DefaultMimeTypes mime_types['rhtml'] = 'text/html' server = HTTPServer.new( :Port => 2000, :MimeTypes => mime_types, :DocumentRoot => File.expand_path(File.dirname(".")) + "/htdo…