2
2
<img src =" doc/logo.png?raw=true " />
3
3
</p >
4
4
5
- Caronte
5
+ node-http-proxy
6
6
=======
7
7
8
- Caronte is an HTTP programmable proxying library that supports
8
+ ` node-http-proxy ` is an HTTP programmable proxying library that supports
9
9
websockets. It is suitable for implementing components such as
10
10
proxies and load balancers.
11
11
@@ -21,12 +21,12 @@ proxies and load balancers.
21
21
### Core Concept
22
22
23
23
A new proxy is created by calling ` createProxyServer ` and passing
24
- an ` options ` object as argument ([ valid properties are available here] ( tree/master/lib/caronte .js#L26-L39 ) )
24
+ an ` options ` object as argument ([ valid properties are available here] ( tree/master/lib/http-proxy .js#L26-L39 ) )
25
25
26
26
``` javascript
27
- var caronte = require (' caronte ' );
27
+ var httpProxy = require (' http-proxy ' );
28
28
29
- var proxy = caronte .createProxyServer (options);
29
+ var proxy = httpProxy .createProxyServer (options);
30
30
```
31
31
32
32
An object will be returned with four values:
@@ -44,7 +44,7 @@ require('http').createServer(function(req, res) {
44
44
});
45
45
```
46
46
47
- When a request is proxied it follows two different pipelines ([ available here] ( tree/master/lib/caronte /passes ) )
47
+ When a request is proxied it follows two different pipelines ([ available here] ( tree/master/lib/http-proxy /passes ) )
48
48
which apply transformations to both the ` req ` and ` res ` object.
49
49
The first pipeline (ingoing) is responsible for the creation and manipulation of the stream that connects your client to the target.
50
50
The second pipeline (outgoing) is responsible for the creation and manipulation of the stream that, from your target, returns data
@@ -58,11 +58,11 @@ In addition, every stage emits a corresponding event so introspection during the
58
58
59
59
``` js
60
60
var http = require (' http' ),
61
- caronte = require (' caronte ' );
61
+ httpProxy = require (' http-proxy ' );
62
62
//
63
63
// Create your proxy server
64
64
//
65
- caronte .createProxyServer ({target: ' http://localhost:9000' }).listen (8000 );
65
+ httpProxy .createProxyServer ({target: ' http://localhost:9000' }).listen (8000 );
66
66
67
67
//
68
68
// Create your target server
@@ -78,12 +78,12 @@ http.createServer(function (req, res) {
78
78
79
79
``` js
80
80
var http = require (' http' ),
81
- caronte = require (' caronte ' );
81
+ httpProxy = require (' http-proxy ' );
82
82
83
83
//
84
84
// Create a proxy server with custom application logic
85
85
//
86
- var proxy = caronte .createProxyServer ({});
86
+ var proxy = httpProxy .createProxyServer ({});
87
87
88
88
var server = require (' http' ).createServer (function (req , res ) {
89
89
proxy .web (req, res, { target: ' http://127.0.0.1:5060' });
@@ -103,7 +103,7 @@ server.listen(5050);
103
103
104
104
### Options
105
105
106
- ` caronte .createProxyServer` supports the following options:
106
+ ` httpProxy .createProxyServer` supports the following options:
107
107
108
108
* ** target** : url string to be parsed with the url module
109
109
* ** forward** : url string to be parsed with the url module
@@ -130,7 +130,7 @@ Logo created by [Diego Pasquali](http://dribbble.com/diegopq)
130
130
131
131
> The MIT License (MIT)
132
132
>
133
- > Copyright (c) 2013 Nodejitsu Inc.
133
+ > Copyright (c) 2010 - 2013 Nodejitsu Inc.
134
134
>
135
135
> Permission is hereby granted, free of charge, to any person obtaining a copy
136
136
> of this software and associated documentation files (the "Software"), to deal
0 commit comments