• This repository has been archived on 09/Nov/2017
  • Stars
    star
    172
  • Rank 220,312 (Top 5 %)
  • Language
    CoffeeScript
  • License
    MIT License
  • Created about 14 years ago
  • Updated about 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Node powered Rack server

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)

More Repositories

1

css-explain

SQL EXPLAIN for CSS selectors
JavaScript
1,069
star
2

selector-set

JavaScript
279
star
3

rails-behaviors

Rails UJS Behaviors for jQuery and Zepto
CoffeeScript
271
star
4

selector-observer

Allows you to monitor DOM elements that match a CSS selector
JavaScript
217
star
5

jquery-selector-set

JavaScript
215
star
6

overcast-sonos

Listen to your Overcast podcasts on Sonos.
PHP
183
star
7

Aware

A simple menubar app for OSX and macOS that tracks how long you've been actively using your computer
Swift
143
star
8

launchdns

A launchd friendly development DNS server
Shell
75
star
9

dotfiles

My $HOME
Shell
63
star
10

imdb-trakt-sync-broken

Sync IMDb to Trakt
Shell
53
star
11

scroll-anchoring

Preserves the user's scroll position while DOM mutations change the page.
HTML
50
star
12

tickerd

A Docker process scheduler
Go
12
star
13

swift-har

A Swift library for encoding, decoding, recording and testing using the HTTP Archive format.
Swift
10
star
14

icloud-backup-utils

Scripts creating backups of iCloud data.
Shell
8
star
15

google-domains-ddns

Dockerfile
7
star
16

workflows

Reusable workflows for GitHub Actions
6
star
17

smtp2webhook

SMTP to Webhook Relay
Go
6
star
18

csv2json

A humble CSV tool, friend of jq
Swift
6
star
19

displayrcd

Run a script when your Mac changes displays
Swift
5
star
20

offlineimap-gmail

Dockerfile
3
star
21

trakt-plex-sync

Sync Trakt history to Plex library
Python
3
star
22

homeassistant-healthchecks

Home Assistant custom component for Healthchecks.io
Python
3
star
23

josh

My GitHub profile
2
star
24

wikidatabots

Wikidata bots running under Josh404Bot
Python
2
star
25

docker-ondemand

Lazily start and automatically stop Docker for Mac
Shell
2
star
26

ConsoleKit

An embeddable SwiftUI OSLog view
Swift
2
star
27

homebrew-tap

Homebrew custom formulas for @josh repositories.
Ruby
2
star
28

mixnmatch-catalogs

Python
2
star
29

itunes-library-export

A command line tool to export iTunes Library XML files.
Swift
2
star
30

wikidata-api-schemas

Wikidata JSON Schemas
Shell
1
star
31

joshpeek.com

Just a bunch of redirects
Dockerfile
1
star
32

smtp2workflow

SMTP to GitHub Actions workflow Relay
Go
1
star
33

us-state-travel-advisories-feeds

JSON feeds for U.S. Department of State Travel Advisories
Python
1
star
34

alamo-drafthouse-feeds

JSON feeds for Alamo Drafthouse showings
Python
1
star
35

overcast-data

Overcast podcast personal data scraper
Python
1
star
36

imdb-plex-sync

Sync IMDb watchlist to Plex watchlist
Python
1
star
37

imdb-data

IMDB personal lists and ratings data scaper
Python
1
star