You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+36
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,42 @@ Caronte is an HTTP programmable proxying library that supports
5
5
websockets. It is suitable for implementing components such as
6
6
proxies and load balancers.
7
7
8
+
### Core Concept
9
+
10
+
A new proxy is created by calling `createProxyServer` and passing
11
+
an `options` object as argument ([valid properties are available here](https://github.com/yawnt/caronte/blob/master/lib/caronte.js#L26-L39))
12
+
13
+
```javascript
14
+
var caronte =require('caronte');
15
+
16
+
var proxy =caronte.createProxyServer(options);
17
+
```
18
+
19
+
An object will be returned with four values:
20
+
21
+
* web `req, res, [options]` (used for proxying regular HTTP(S) requests)
When a request is proxied it follows two different pipelines ([available here](https://github.com/yawnt/caronte/tree/master/lib/caronte/passes))
35
+
which apply trasformations to both the `req` and `res` object.
36
+
The first pipeline (ingoing) is responsible for the creation and manipulation of the stream that connects your client to the target.
37
+
The second pipeline (outgoing) is responsible for the creation and manipulation of the stream that, from your target, returns datas
38
+
to the client.
39
+
40
+
You can easily add a `pass` (stages) into both the pipelines (XXX: ADD API).
41
+
42
+
In addition, every stage emits a corresponding event so introspection during the process is always available.
0 commit comments