Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Node powered Rack server

nack 0.16.0

latest commit d523cc870c
Joshua Peek authored
Octocat-spinner-32 bin Use new connect api March 18, 2013
Octocat-spinner-32 doc Update doc manifest October 26, 2010
Octocat-spinner-32 lib Attempt to load json after config November 18, 2013
Octocat-spinner-32 man Rebuild man pages January 05, 2011
Octocat-spinner-32 src Remove old multiple header hack April 25, 2013
Octocat-spinner-32 test Server tests use JSON const directly November 18, 2013
Octocat-spinner-32 .envrc Add envrc September 25, 2011
Octocat-spinner-32 .gitignore Upgrade to netstring 0.2 May 08, 2011
Octocat-spinner-32 .npmignore Don't ignore .git* March 25, 2011
Octocat-spinner-32 .travis.yml Test on node 0.10.x March 18, 2013
Octocat-spinner-32 Cakefile Add pretest November 14, 2011
Octocat-spinner-32 LICENSE Initial commit September 13, 2010
Octocat-spinner-32 Require node 0.6 March 18, 2013
Octocat-spinner-32 Rakefile Ensure lib is in path November 18, 2013
Octocat-spinner-32 index.js Flatten namespace March 25, 2011
Octocat-spinner-32 package.json nack 0.16.0 November 18, 2013

nack -- Node powered Rack server


nack is a Rack server built on top of the Node.js HTTP server. Node does all the hard work of accepting and parsing HTTP requests and nack simply passes it along to a Ruby worker process as a serialized object. You can read more about how the [IPC protocol][nack-protocol(7)] works. Besides running as a standalone Rack server, you can use the JS API to run multiple apps from the same Node process.


Simple proxy

var http = require('http');
var nack = require('nack');

var app = nack.createProcess("/path/to/app/");

http.createServer(function (req, res) {
  app.proxy(req, res);
}).listen(8124, "");

You can spawn up a pool of workers with:

var nack = require('nack');
nack.createPool("/path/to/app/", { size: 3 });

Workers can idle out after a period of inactivity:

// Timeout after 15m
nack.createPool("/path/to/app/", { idle: 15 * 60 * 1000 });

Theres a more friendly server API that returns a Connect application.

var connect = require('connect');
var nack    = require('nack');



You can grab the package from npm.

npm install nack


  • node >= 0.6.x
  • node-netstring
  • rack
  • json


nack was design to be used as a local development proxy. You probably don't wanna try running a production app on it. I'm sure its slow too so don't send me any benchmarks.


Copyright (c) 2010 Joshua Peek.

Released under the MIT license. See LICENSE for details.


nack(1), nack-protocol(7), nack-server(3), nack-pool(3), nack-process(3)

Something went wrong with that request. Please try again.