Skip to content

Commit edd8e2f

Browse files
committed
ENH: updated readme with an example
1 parent ef946a7 commit edd8e2f

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

+19
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,25 @@ You can easily add a `pass` (stages) into both the pipelines (XXX: ADD API).
4545

4646
In addition, every stage emits a corresponding event so introspection during the process is always available.
4747

48+
#### Setup a stand-alone proxy server with custom server logic
49+
50+
``` js
51+
var http = require('http'),
52+
caronte = require('caronte');
53+
54+
//
55+
// Create a proxy server with custom application logic
56+
//
57+
var proxy = caronte.createProxyServer({});
58+
59+
var server = require('http').createServer(function(req, res) {
60+
proxy.web(req, res, { target: 'http://127.0.0.1:5060' });
61+
});
62+
63+
console.log("listening on port 5050")
64+
server.listen(5050);
65+
```
66+
4867
### Contributing and Issues
4968

5069
* Search on Google/Github

0 commit comments

Comments
 (0)