Giter VIP home page Giter VIP logo

nack's Introduction

nack -- Node powered Rack server

DESCRIPTION

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.

EXAMPLES

Simple proxy

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

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

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

You can spawn up a pool of workers with:

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

Workers can idle out after a period of inactivity:

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

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

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

connect.createServer(
  connect.logger(),
  connect.vhost('foo.test',
    nack.createServer("/u/apps/foo/config.ru")
  ),
  connect.vhost('bar.test',
    nack.createServer("/u/apps/bar/config.ru")
  )
).listen(3000);

INSTALL

You can grab the package from npm.

npm install nack

DEPENDENCIES

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

CAVEATS

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.

LICENSE

Copyright (c) 2010 Joshua Peek.

Released under the MIT license. See LICENSE for details.

SEE ALSO

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

nack's People

Contributors

alexcrichton avatar josh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.