Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

notes about bouncy the command

  • Loading branch information...
commit 122eb0049198707d1c2c726b94718309c8d94851 1 parent 73f3e16
@substack authored
Showing with 25 additions and 10 deletions.
  1. +24 −9 README.markdown
  2. +1 −1  package.json
View
33 README.markdown
@@ -4,7 +4,8 @@ bouncy
Bouncy uses node's http parser innards to bounce http requests around to where
they need to go in an entirely transparent way.
-Use bouncy as a load balancer or http host router.
+Use bouncy as a load balancer or http host router, either programmatically or
+with the simple command-line tool.
Bouncy is websocket-capable.
@@ -29,19 +30,27 @@ bouncy(function (req, bounce) {
}).listen(8000);
````
-bounce.js
----------
+command-line
+============
-Bounce all requests received on :8001 along to :8000
+Just create a `routes.json` file like this:
````javascript
-var bouncy = require('bouncy');
-
-bouncy(function (req, bounce) {
- bounce(8000);
-}).listen(8001);
+{
+ "beep.example.com" : 8000,
+ "boop.example.com" : 8001
+}
````
+Then point the `bouncy` command at this `routes.json` file and give it a port to
+listen on:
+
+ bouncy routes.json 80
+
+The `routes.json` file should just map host names to host/port combos.
+Use a colon-separated string to specify a host and port in a route.
+Use `''` as a default route.
+
bouncy(cb)
==========
@@ -76,6 +85,12 @@ With [npm](http://npmjs.org), do:
npm install bouncy
+to install as a library or
+
+ npm install -g bouncy
+
+to get the command-line tool.
+
license
=======
View
2  package.json
@@ -1,7 +1,7 @@
{
"name" : "bouncy",
"description" : "Bounce HTTP requests around for a load balancer or http host router completely transparently",
- "version" : "0.0.3",
+ "version" : "0.0.4",
"repository" : {
"type" : "git",
"url" : "git://github.com/substack/bouncy.git"
Please sign in to comment.
Something went wrong with that request. Please try again.