From edd8e2f04e4b39391b062fa6437d61b4ebde8748 Mon Sep 17 00:00:00 2001 From: srossross Date: Mon, 16 Sep 2013 11:01:34 -0700 Subject: [PATCH] ENH: updated readme with an example --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index 86e7ff7..ea381d2 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,25 @@ You can easily add a `pass` (stages) into both the pipelines (XXX: ADD API). In addition, every stage emits a corresponding event so introspection during the process is always available. +#### Setup a stand-alone proxy server with custom server logic + +``` js +var http = require('http'), + caronte = require('caronte'); + +// +// Create a proxy server with custom application logic +// +var proxy = caronte.createProxyServer({}); + +var server = require('http').createServer(function(req, res) { + proxy.web(req, res, { target: 'http://127.0.0.1:5060' }); +}); + +console.log("listening on port 5050") +server.listen(5050); +``` + ### Contributing and Issues * Search on Google/Github