dummy-link

Mongrel2

Mongrel2 handlers in Julia

Readme

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.

Installation

Pkg.add("Mongrel2")

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

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

Usage

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

load("Mongrel2")
using Mongrel2

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

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

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

First Commit

12/04/2012

Last Touched

over 2 years ago

Commits

13 commits

Requires:

Used By: