Mongrel2 handlers in Julia
2 Stars
Updated Last
3 Years Ago
Started In
December 2012

#A Julia interface to Mongrel2

This package is deprecated. The Mongrel2 webserver hasn't turned out to be very popular, and Julia now has a native web server. Therefore, my current reccomendation is to use HTTPServer, fronted by an nginx or Apache2 reverse proxy

Mongrel2.jl is a package that enables writing [Mongrel2] ( handlers in the [Julia] ( programming language.



This will also install the dependent Julia packages: [ZMQ] ( and [JSON] (

Install Mongrel2 and ZMQ libraries for your OS using your favourite package manager


Start Mongrel2 in the usual fashion with m2sh using a relevant configuration. [Example] (

using Mongrel2

t = run_server("6DFF1523-C091-49B8-B635-598640E864B3", "tcp://", "tcp://")

 while true                                                                                            
    (conn, req) = consume (t) 
    response = "<html><body>Sender: $(req.sender_id)<br>ConnectionId: $(req.connection_id)<br>
                  Path: $(req.path)<br>Headers: $(string(req.headers))<br> Body: $(req.body)</html></body>"
    if is_disconnected(req); print("Disconnected $(req.connection_id) \n");continue; end
    reply_http(conn, req, response); disconnect_client(conn,req);

Navigate to http://localhost:6767/handlertest/