Skip to content
JavaScript CoffeeScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
.gitignore
LICENSE license and readme
README.md
mongrel2.conf
package.json

README.md

Notice

Please see m2njs!

Since taking over this abandoned project, I have updated the source, and republished under m2njs. You can install the latest version of this Mongrel2 handler for Node.js using npm:

npm install m2njs

With that said, the instructions below are still valid and work, with exception of 'mongrel2' now becomes 'm2njs'.

node-mongrel2

A Mongrel2 handler for nodejs.

Howto

This isn't an intro to Mongrel2. Try the Mongrel2 Manual for that.

Install with npm:

% npm install mongrel2

Use it in your code:

var mongrel2 = require('mongrel2');

// mongrel2.connect(recv_spec, send_spec, identify, callback)
// recv_spec is what you configure as your send_spec in your mongrel2.conf
// send_spec is vice versa
mongrel2.connect('tcp://127.0.0.1:9997', 'tcp://127.0.0.1:9996', 'test', function(msg, reply) {
  // do some logic
  reply(200, { 'Content-Type': 'text/plain' }, "Hello, World!\n" + JSON.stringify(msg));
});

Copyright

Copyright (c) 2010 Daniel Huckstep. See LICENSE for details.

Something went wrong with that request. Please try again.