Skip to content
EntityQ1737219· pop 6· linked from 92 articles

HTTP library and web server

Source code

What makes Mongrel so fast is the careful use of an Ragel extension to provide fast, accurate HTTP 1.1 protocol parsing. This makes the server scream without too many portability issues. All of which should be done from your application's directory. It writes the PID of the process you ran into log/mongrel.pid. There are also many more new options for configuring the rails runner including changing to a different directory, adding more MIME types, and setting processor threads and timeouts. It doesn't explicitly require Camping, but if you want to run the examples/camping/ examples then you'll need to install Camping 1.2 at least (and redcloth I think). These are all available from RubyGems. class SimpleHandler < Mongrel::HttpHandler def process(request, response) response.start(200) do head,out head["Content-Type"] = "text/plain" out.write("hello! n") end end end If you run this and access port 3000 with a browser it will say "hello!". If you access it with any url other than "/test" it will give a simple 404. Check out the Mongrel::Error404Handler for a basic way to give a more complex 404 message. This also shows the DirHandler with directory listings. This is still rough but it should work for basic hosting. File extension to mime type mapping is missing though. E-mail the Mongrel list at and someone will help you. Comments about the API are welcome.

Excerpt from the source-code README · 3,088 chars · not written by Vinony

Wikidata facts

Official website
mongrel.rubyforge.org
Has use
web server
Show 5 more facts
copyright license
Ruby License
software version identifier
1.0.1
source code repository URL
github.com/mongrel/mongrel
programmed in
Ruby
uses
Ruby
Sources (4)

via Wikidata · CC0

Article · Русский

Mongrel — open-source HTTP-библиотека и веб-сервер, основанные на Ruby и написанные Зедом Шоу (Zed Shaw). Используется для запуска Ruby веб-приложений и предоставления стандартного HTTP-интерфейса. Это делает возможным использование отдельных слоев, таких как , балансировщика нагрузки или комбинацию обоих подходов, вместо необходимости использовать более традиционные методы, используемые для запуска сценариев, такие как FastCGI или SCGI. Это стало возможным за счет интеграции анализатора пользовательских высокопроизводительных HTTP запросов — Ragel. С 2010 года проект больше не развивается, код Mongrel больше не поддерживается Ruby начиная с версии 1.9.2. Ему на замену пришёл , который уже не привязан к конкретному языку или фреймворку и не имеет ничего общего с реализацией Mongrel за исключением парсера HTTP-запросов.

Abstract from DBpedia / Wikipedia · CC BY-SA

Available in 6 languages

via Wikidata sitelinks · CC0