Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 444 lines (355 sloc) 14.32 kb
bdf48bea »
2011-09-10 [doc] Drop version number from README.md.
1 # node-http-proxy
d6a2f8aa »
2010-07-24 added readme
2
40c51a70 »
2011-04-17 [minor] Small update to README.md
3 <img src="http://i.imgur.com/8fTt9.png" />
341bbd40 »
2010-07-27 updating docs
4
15943675 »
2010-07-27 updated docs
5 ## Battle-hardened node.js http proxy
d6a2f8aa »
2010-07-24 added readme
6
2f49810e »
2010-07-27 [dist] Renamed node-proxy to node-http-proxy, updated package.json
7 ### Features
d6a2f8aa »
2010-07-24 added readme
8
57153182 »
2011-03-10 [doc api test] Wrap things up for v0.4.0 release: Add hostnameOnly ro…
9 * Reverse proxies incoming http.ServerRequest streams
10 * Can be used as a CommonJS module in node.js
11 * Uses event buffering to support application latency in proxied requests
12 * Reverse or Forward Proxy based on simple JSON-based configuration
212009df »
2011-04-17 [doc api] Update README.md and CHANGELOG.md for v0.5.0. Update bin/no…
13 * Supports [WebSockets][1]
14 * Supports [HTTPS][2]
57153182 »
2011-03-10 [doc api test] Wrap things up for v0.4.0 release: Add hostnameOnly ro…
15 * Minimal request overhead and latency
16 * Full suite of functional tests
17 * Battled-hardened through __production usage__ @ [nodejitsu.com][0]
18 * Written entirely in Javascript
19 * Easy to use API
d6a2f8aa »
2010-07-24 added readme
20
2f49810e »
2010-07-27 [dist] Renamed node-proxy to node-http-proxy, updated package.json
21 ### When to use node-http-proxy
22
23 Let's suppose you were running multiple http application servers, but you only wanted to expose one machine to the internet. You could setup node-http-proxy on that one machine and then reverse-proxy the incoming http requests to locally running services which were not exposed to the outside network.
24
341bbd40 »
2010-07-27 updating docs
25 ### Installing npm (node package manager)
ab8c264e »
2011-05-17 add spacing around code blocks to fix README rendering
26
d5b9ba71 »
2011-05-17 don't highlight non-javascript as javascript
27 ```
28f6dc15 »
2011-05-17 format markdown for syntax highlighting on GitHub
28 curl http://npmjs.org/install.sh | sh
29 ```
341bbd40 »
2010-07-27 updating docs
30
2f49810e »
2010-07-27 [dist] Renamed node-proxy to node-http-proxy, updated package.json
31 ### Installing node-http-proxy
ab8c264e »
2011-05-17 add spacing around code blocks to fix README rendering
32
d5b9ba71 »
2011-05-17 don't highlight non-javascript as javascript
33 ```
28f6dc15 »
2011-05-17 format markdown for syntax highlighting on GitHub
34 npm install http-proxy
35 ```
b1eb13eb »
2010-07-27 added createServer but hated it, gonna remove
36
bedc7a3a »
2010-11-21 [api test doc] Updated tests. Added ProxyTable functionality
37 ## Using node-http-proxy
38
39 There are several ways to use node-http-proxy; the library is designed to be flexible so that it can be used by itself, or in conjunction with other node.js libraries / tools:
40
41 1. Standalone HTTP Proxy server
42 2. Inside of another HTTP server (like Connect)
c06f4bf7 »
2010-11-21 [test doc api] Added forward proxy functionality with tests
43 3. In conjunction with a Proxy Routing Table
44 4. As a forward-proxy with a reverse proxy
de53d5eb »
2010-11-22 [doc dist] Version bump. Added CHANGELOG.md
45 5. From the command-line as a long running process
5bf2d592 »
2011-07-30 [doc] add note on middleware to Using node-http-proxy section of the …
46 6. customized with 3rd party middleware.
bedc7a3a »
2010-11-21 [api test doc] Updated tests. Added ProxyTable functionality
47
212009df »
2011-04-17 [doc api] Update README.md and CHANGELOG.md for v0.5.0. Update bin/no…
48 In each of these scenarios node-http-proxy can handle any of these types of requests:
49
50 1. HTTP Requests (http://)
51 2. HTTPS Requests (https://)
52 3. WebSocket Requests (ws://)
03b90874 »
2011-05-17 [doc minor] Update docs and code docs for v0.5.3 release
53 4. Secure WebSocket Requests (wss://)
212009df »
2011-04-17 [doc api] Update README.md and CHANGELOG.md for v0.5.0. Update bin/no…
54
55 See the [examples][3] for more working sample code.
00014d62 »
2010-11-21 [api test bin doc] Added bin script and simple logging
56
bedc7a3a »
2010-11-21 [api test doc] Updated tests. Added ProxyTable functionality
57 ### Setup a basic stand-alone proxy server
ab8c264e »
2011-05-17 add spacing around code blocks to fix README rendering
58
28f6dc15 »
2011-05-17 format markdown for syntax highlighting on GitHub
59 ``` js
60 var http = require('http'),
61 httpProxy = require('http-proxy');
62 //
63 // Create your proxy server
64 //
65 httpProxy.createServer(9000, 'localhost').listen(8000);
66
67 //
68 // Create your target server
69 //
70 http.createServer(function (req, res) {
71 res.writeHead(200, { 'Content-Type': 'text/plain' });
72 res.write('request successfully proxied!' + '\n' + JSON.stringify(req.headers, true, 2));
73 res.end();
74 }).listen(9000);
75 ```
6e651f42 »
2010-07-27 updating docs, almost there
76
bedc7a3a »
2010-11-21 [api test doc] Updated tests. Added ProxyTable functionality
77 ### Setup a stand-alone proxy server with custom server logic
ab8c264e »
2011-05-17 add spacing around code blocks to fix README rendering
78
28f6dc15 »
2011-05-17 format markdown for syntax highlighting on GitHub
79 ``` js
80 var http = require('http'),
81 httpProxy = require('http-proxy');
82
83 //
84 // Create a proxy server with custom application logic
85 //
86 httpProxy.createServer(function (req, res, proxy) {
41104480 »
2011-03-09 [doc api test] Rename HttpProxy.pause to HttpProxy.resume. Update doc…
87 //
28f6dc15 »
2011-05-17 format markdown for syntax highlighting on GitHub
88 // Put your custom server logic here
41104480 »
2011-03-09 [doc api test] Rename HttpProxy.pause to HttpProxy.resume. Update doc…
89 //
28f6dc15 »
2011-05-17 format markdown for syntax highlighting on GitHub
90 proxy.proxyRequest(req, res, {
91 host: 'localhost',
92 port: 9000
93 });
94 }).listen(8000);
a9084b92 »
2010-09-09 [api test dist doc] Updated for 0.3.0 release
95
28f6dc15 »
2011-05-17 format markdown for syntax highlighting on GitHub
96 http.createServer(function (req, res) {
97 res.writeHead(200, { 'Content-Type': 'text/plain' });
98 res.write('request successfully proxied: ' + req.url +'\n' + JSON.stringify(req.headers, true, 2));
99 res.end();
100 }).listen(9000);
101 ```
a9084b92 »
2010-09-09 [api test dist doc] Updated for 0.3.0 release
102
bedc7a3a »
2010-11-21 [api test doc] Updated tests. Added ProxyTable functionality
103 ### Setup a stand-alone proxy server with latency (e.g. IO, etc)
ab8c264e »
2011-05-17 add spacing around code blocks to fix README rendering
104
28f6dc15 »
2011-05-17 format markdown for syntax highlighting on GitHub
105 ``` js
106 var http = require('http'),
107 httpProxy = require('http-proxy');
108
109 //
110 // Create a proxy server with custom application logic
111 //
112 httpProxy.createServer(function (req, res, proxy) {
41104480 »
2011-03-09 [doc api test] Rename HttpProxy.pause to HttpProxy.resume. Update doc…
113 //
28f6dc15 »
2011-05-17 format markdown for syntax highlighting on GitHub
114 // Buffer the request so that `data` and `end` events
115 // are not lost during async operation(s).
41104480 »
2011-03-09 [doc api test] Rename HttpProxy.pause to HttpProxy.resume. Update doc…
116 //
0ba5023e »
2011-09-10 [doc] Update README.md
117 var buffer = httpProxy.buffer(req);
28f6dc15 »
2011-05-17 format markdown for syntax highlighting on GitHub
118
41104480 »
2011-03-09 [doc api test] Rename HttpProxy.pause to HttpProxy.resume. Update doc…
119 //
28f6dc15 »
2011-05-17 format markdown for syntax highlighting on GitHub
120 // Wait for two seconds then respond: this simulates
121 // performing async actions before proxying a request
41104480 »
2011-03-09 [doc api test] Rename HttpProxy.pause to HttpProxy.resume. Update doc…
122 //
28f6dc15 »
2011-05-17 format markdown for syntax highlighting on GitHub
123 setTimeout(function () {
124 proxy.proxyRequest(req, res, {
125 host: 'localhost',
126 port: 9000,
127 buffer: buffer
128 });
129 }, 2000);
130 }).listen(8000);
131
132 http.createServer(function (req, res) {
133 res.writeHead(200, { 'Content-Type': 'text/plain' });
134 res.write('request successfully proxied: ' + req.url +'\n' + JSON.stringify(req.headers, true, 2));
135 res.end();
136 }).listen(9000);
137 ```
41104480 »
2011-03-09 [doc api test] Rename HttpProxy.pause to HttpProxy.resume. Update doc…
138
28f6dc15 »
2011-05-17 format markdown for syntax highlighting on GitHub
139 ### Proxy requests within another http server
ab8c264e »
2011-05-17 add spacing around code blocks to fix README rendering
140
28f6dc15 »
2011-05-17 format markdown for syntax highlighting on GitHub
141 ``` js
142 var http = require('http'),
143 httpProxy = require('http-proxy');
144
145 //
146 // Create a new instance of HttProxy to use in your server
147 //
24ef9194 »
2011-09-21 [docs] Updated examples in README.md for 0.7.x API.
148 var proxy = new httpProxy.RoutingProxy();
28f6dc15 »
2011-05-17 format markdown for syntax highlighting on GitHub
149
150 //
151 // Create a regular http server and proxy its handler
152 //
153 http.createServer(function (req, res) {
41104480 »
2011-03-09 [doc api test] Rename HttpProxy.pause to HttpProxy.resume. Update doc…
154 //
28f6dc15 »
2011-05-17 format markdown for syntax highlighting on GitHub
155 // Put your custom server logic here, then proxy
41104480 »
2011-03-09 [doc api test] Rename HttpProxy.pause to HttpProxy.resume. Update doc…
156 //
28f6dc15 »
2011-05-17 format markdown for syntax highlighting on GitHub
157 proxy.proxyRequest(req, res, {
158 host: 'localhost',
159 port: 9000
160 });
161 }).listen(8001);
76d0649a »
2010-08-02 updated readme
162
28f6dc15 »
2011-05-17 format markdown for syntax highlighting on GitHub
163 http.createServer(function (req, res) {
164 res.writeHead(200, { 'Content-Type': 'text/plain' });
165 res.write('request successfully proxied: ' + req.url +'\n' + JSON.stringify(req.headers, true, 2));
166 res.end();
167 }).listen(9000);
168 ```
5d94ae27 »
2010-08-01 [api] More changes for createServer api
169
bedc7a3a »
2010-11-21 [api test doc] Updated tests. Added ProxyTable functionality
170 ### Proxy requests using a ProxyTable
171 A Proxy Table is a simple lookup table that maps incoming requests to proxy target locations. Take a look at an example of the options you need to pass to httpProxy.createServer:
ab8c264e »
2011-05-17 add spacing around code blocks to fix README rendering
172
28f6dc15 »
2011-05-17 format markdown for syntax highlighting on GitHub
173 ``` js
174 var options = {
175 router: {
176 'foo.com/baz': '127.0.0.1:8001',
177 'foo.com/buz': '127.0.0.1:8002',
178 'bar.com/buz': '127.0.0.1:8003'
179 }
180 };
181 ```
bedc7a3a »
2010-11-21 [api test doc] Updated tests. Added ProxyTable functionality
182
57153182 »
2011-03-10 [doc api test] Wrap things up for v0.4.0 release: Add hostnameOnly ro…
183 The above route table will take incoming requests to 'foo.com/baz' and forward them to '127.0.0.1:8001'. Likewise it will take incoming requests to 'foo.com/buz' and forward them to '127.0.0.1:8002'. The routes themselves are later converted to regular expressions to enable more complex matching functionality. We can create a proxy server with these options by using the following code:
ab8c264e »
2011-05-17 add spacing around code blocks to fix README rendering
184
28f6dc15 »
2011-05-17 format markdown for syntax highlighting on GitHub
185 ``` js
186 var proxyServer = httpProxy.createServer(options);
187 proxyServer.listen(80);
188 ```
c06f4bf7 »
2010-11-21 [test doc api] Added forward proxy functionality with tests
189
57153182 »
2011-03-10 [doc api test] Wrap things up for v0.4.0 release: Add hostnameOnly ro…
190 ### Proxy requests using a 'Hostname Only' ProxyTable
191 As mentioned in the previous section, all routes passes to the ProxyTable are by default converted to regular expressions that are evaluated at proxy-time. This is good for complex URL rewriting of proxy requests, but less efficient when one simply wants to do pure hostname routing based on the HTTP 'Host' header. If you are only concerned with hostname routing, you change the lookup used by the internal ProxyTable:
192
28f6dc15 »
2011-05-17 format markdown for syntax highlighting on GitHub
193 ``` js
194 var options = {
195 hostnameOnly: true,
196 router: {
197 'foo.com': '127.0.0.1:8001',
198 'bar.com': '127.0.0.1:8002'
57153182 »
2011-03-10 [doc api test] Wrap things up for v0.4.0 release: Add hostnameOnly ro…
199 }
28f6dc15 »
2011-05-17 format markdown for syntax highlighting on GitHub
200 }
201 ```
57153182 »
2011-03-10 [doc api test] Wrap things up for v0.4.0 release: Add hostnameOnly ro…
202
212009df »
2011-04-17 [doc api] Update README.md and CHANGELOG.md for v0.5.0. Update bin/no…
203 Notice here that I have not included paths on the individual domains because this is not possible when using only the HTTP 'Host' header. Care to learn more? See [RFC2616: HTTP/1.1, Section 14.23, "Host"][4].
57153182 »
2011-03-10 [doc api test] Wrap things up for v0.4.0 release: Add hostnameOnly ro…
204
c06f4bf7 »
2010-11-21 [test doc api] Added forward proxy functionality with tests
205 ### Proxy requests with an additional forward proxy
206 Sometimes in addition to a reverse proxy, you may want your front-facing server to forward traffic to another location. For example, if you wanted to load test your staging environment. This is possible when using node-http-proxy using similar JSON-based configuration to a proxy table:
ab8c264e »
2011-05-17 add spacing around code blocks to fix README rendering
207
28f6dc15 »
2011-05-17 format markdown for syntax highlighting on GitHub
208 ``` js
209 var proxyServerWithForwarding = httpProxy.createServer(9000, 'localhost', {
210 forward: {
211 port: 9000,
212 host: 'staging.com'
213 }
214 });
215 proxyServerWithForwarding.listen(80);
216 ```
bedc7a3a »
2010-11-21 [api test doc] Updated tests. Added ProxyTable functionality
217
c06f4bf7 »
2010-11-21 [test doc api] Added forward proxy functionality with tests
218 The forwarding option can be used in conjunction with the proxy table options by simply including both the 'forward' and 'router' properties in the options passed to 'createServer'.
219
ab8c264e »
2011-05-17 add spacing around code blocks to fix README rendering
220
abc01bce »
2011-05-18 [doc] Update README.md to reflect the new HTTPS to HTTP proxy capabil…
221 ## Using HTTPS
222 You have all the full flexibility of node-http-proxy offers in HTTPS as well as HTTP. The two basic scenarios are: with a stand-alone proxy server or in conjunction with another HTTPS server.
223
224 ### Proxying to HTTP from HTTPS
225 This is probably the most common use-case for proxying in conjunction with HTTPS. You have some front-facing HTTPS server, but all of your internal traffic is HTTP. In this way, you can reduce the number of servers to which your CA and other important security files are deployed and reduce the computational overhead from HTTPS traffic.
226
227 Using HTTPS in `node-http-proxy` is relatively straight-forward:
32a15dd7 »
2011-05-18 [minor] Update README.md to conform to Github flavored markdown
228
28f6dc15 »
2011-05-17 format markdown for syntax highlighting on GitHub
229 ``` js
abc01bce »
2011-05-18 [doc] Update README.md to reflect the new HTTPS to HTTP proxy capabil…
230 var fs = require('fs'),
231 http = require('http'),
232 https = require('https'),
233 httpProxy = require('http-proxy');
234
235 var options = {
236 https: {
237 key: fs.readFileSync('path/to/your/key.pem', 'utf8'),
238 cert: fs.readFileSync('path/to/your/cert.pem', 'utf8')
239 }
240 };
00014d62 »
2010-11-21 [api test bin doc] Added bin script and simple logging
241
abc01bce »
2011-05-18 [doc] Update README.md to reflect the new HTTPS to HTTP proxy capabil…
242 //
243 // Create a standalone HTTPS proxy server
244 //
245 httpProxy.createServer(8000, 'localhost', options).listen(8001);
00014d62 »
2010-11-21 [api test bin doc] Added bin script and simple logging
246
abc01bce »
2011-05-18 [doc] Update README.md to reflect the new HTTPS to HTTP proxy capabil…
247 //
248 // Create an instance of HttpProxy to use with another HTTPS server
249 //
24ef9194 »
2011-09-21 [docs] Updated examples in README.md for 0.7.x API.
250 var proxy = new httpProxy.HttpProxy({
251 target: {
abc01bce »
2011-05-18 [doc] Update README.md to reflect the new HTTPS to HTTP proxy capabil…
252 host: 'localhost',
253 port: 8000
24ef9194 »
2011-09-21 [docs] Updated examples in README.md for 0.7.x API.
254 }
255 });
256 https.createServer(options.https, function (req, res) {
257 proxy.proxyRequest(req, res)
abc01bce »
2011-05-18 [doc] Update README.md to reflect the new HTTPS to HTTP proxy capabil…
258 }).listen(8002);
259
260 //
261 // Create the target HTTPS server for both cases
262 //
263 http.createServer(function (req, res) {
264 res.writeHead(200, { 'Content-Type': 'text/plain' });
265 res.write('hello https\n');
266 res.end();
267 }).listen(8000);
28f6dc15 »
2011-05-17 format markdown for syntax highlighting on GitHub
268 ```
00014d62 »
2010-11-21 [api test bin doc] Added bin script and simple logging
269
abc01bce »
2011-05-18 [doc] Update README.md to reflect the new HTTPS to HTTP proxy capabil…
270 ### Proxying to HTTPS from HTTPS
24ef9194 »
2011-09-21 [docs] Updated examples in README.md for 0.7.x API.
271 Proxying from HTTPS to HTTPS is essentially the same as proxying from HTTPS to HTTP, but you must include the `target` option in when calling `httpProxy.createServer` or instantiating a new instance of `HttpProxy`.
ab8c264e »
2011-05-17 add spacing around code blocks to fix README rendering
272
28f6dc15 »
2011-05-17 format markdown for syntax highlighting on GitHub
273 ``` js
274 var fs = require('fs'),
275 https = require('https'),
276 httpProxy = require('http-proxy');
277
278 var options = {
279 https: {
280 key: fs.readFileSync('path/to/your/key.pem', 'utf8'),
281 cert: fs.readFileSync('path/to/your/cert.pem', 'utf8')
abc01bce »
2011-05-18 [doc] Update README.md to reflect the new HTTPS to HTTP proxy capabil…
282 },
283 target: {
284 https: true // This could also be an Object with key and cert properties
28f6dc15 »
2011-05-17 format markdown for syntax highlighting on GitHub
285 }
286 };
287
288 //
289 // Create a standalone HTTPS proxy server
290 //
291 httpProxy.createServer(8000, 'localhost', options).listen(8001);
292
293 //
294 // Create an instance of HttpProxy to use with another HTTPS server
295 //
abc01bce »
2011-05-18 [doc] Update README.md to reflect the new HTTPS to HTTP proxy capabil…
296 var proxy = new httpProxy.HttpProxy({
297 target: {
24ef9194 »
2011-09-21 [docs] Updated examples in README.md for 0.7.x API.
298 host: 'localhost',
299 port: 8000,
abc01bce »
2011-05-18 [doc] Update README.md to reflect the new HTTPS to HTTP proxy capabil…
300 https: true
301 }
302 });
303
28f6dc15 »
2011-05-17 format markdown for syntax highlighting on GitHub
304 https.createServer(options.https, function (req, res) {
24ef9194 »
2011-09-21 [docs] Updated examples in README.md for 0.7.x API.
305 proxy.proxyRequest(req, res);
28f6dc15 »
2011-05-17 format markdown for syntax highlighting on GitHub
306 }).listen(8002);
307
308 //
309 // Create the target HTTPS server for both cases
310 //
311 https.createServer(options.https, function (req, res) {
312 res.writeHead(200, { 'Content-Type': 'text/plain' });
313 res.write('hello https\n');
314 res.end();
315 }).listen(8000);
316 ```
b5d5eaab »
2011-07-25 [doc] note in readme about middleware
317 ## Middleware
318
319 `node-http-proxy` now supports connect middleware. Add middleware functions to your createServer call:
320
321 ``` js
322 httpProxy.createServer(
323 require('connect-gzip').gzip(),
324 9000, 'localhost'
325 ).listen(8000);
326 ```
212009df »
2011-04-17 [doc api] Update README.md and CHANGELOG.md for v0.5.0. Update bin/no…
327
abc01bce »
2011-05-18 [doc] Update README.md to reflect the new HTTPS to HTTP proxy capabil…
328 ## Proxying WebSockets
24ef9194 »
2011-09-21 [docs] Updated examples in README.md for 0.7.x API.
329 Websockets are handled automatically when using `httpProxy.createServer()`, but if you want to use it in conjunction with a stand-alone HTTP + WebSocket (such as [socket.io][5]) server here's how:
ab8c264e »
2011-05-17 add spacing around code blocks to fix README rendering
330
28f6dc15 »
2011-05-17 format markdown for syntax highlighting on GitHub
331 ``` js
332 var http = require('http'),
333 httpProxy = require('http-proxy');
334
335 //
336 // Create an instance of node-http-proxy
337 //
843901ee »
2012-04-03 [doc] add missing {} to make an object
338 var proxy = new httpProxy.HttpProxy({
ed06af97 »
2012-04-03 [doc] Fix style in websockets example
339 target: {
340 host: 'localhost',
341 port: 8000
342 }
343 });
28f6dc15 »
2011-05-17 format markdown for syntax highlighting on GitHub
344
345 var server = http.createServer(function (req, res) {
212009df »
2011-04-17 [doc api] Update README.md and CHANGELOG.md for v0.5.0. Update bin/no…
346 //
28f6dc15 »
2011-05-17 format markdown for syntax highlighting on GitHub
347 // Proxy normal HTTP requests
212009df »
2011-04-17 [doc api] Update README.md and CHANGELOG.md for v0.5.0. Update bin/no…
348 //
24ef9194 »
2011-09-21 [docs] Updated examples in README.md for 0.7.x API.
349 proxy.proxyRequest(req, res);
28f6dc15 »
2011-05-17 format markdown for syntax highlighting on GitHub
350 });
351
352 server.on('upgrade', function(req, socket, head) {
353 //
354 // Proxy websocket requests too
355 //
24ef9194 »
2011-09-21 [docs] Updated examples in README.md for 0.7.x API.
356 proxy.proxyWebSocketRequest(req, socket, head);
28f6dc15 »
2011-05-17 format markdown for syntax highlighting on GitHub
357 });
4fc1ee85 »
2012-04-03 [doc] call listen() to get the server started
358
359 server.listen(8080);
28f6dc15 »
2011-05-17 format markdown for syntax highlighting on GitHub
360 ```
212009df »
2011-04-17 [doc api] Update README.md and CHANGELOG.md for v0.5.0. Update bin/no…
361
d6c54369 »
2011-09-10 [doc] Document `setMaxSockets`. Fixes #81
362 ### Configuring your Socket limits
363
729496d2 »
2011-10-20 grammar correction
364 By default, `node-http-proxy` will set a 100 socket limit for all `host:port` proxy targets. You can change this in two ways:
d6c54369 »
2011-09-10 [doc] Document `setMaxSockets`. Fixes #81
365
366 1. By passing the `maxSockets` option to `httpProxy.createServer()`
367 2. By calling `httpProxy.setMaxSockets(n)`, where `n` is the number of sockets you with to use.
368
73e415a2 »
2012-02-06 Address ticket #180 here since that problem is so hard to discover wh…
369 ## POST requests and buffering
370
371 express.bodyParser will interfere with proxying of POST requests (and other methods that have a request
e15db4fb »
2012-03-01 fix the broken english and clarified the sentence (I hope)
372 body). With bodyParser active, proxied requests will never send anything to the upstream server, and
373 the original client will just hang. See https://github.com/nodejitsu/node-http-proxy/issues/180 for options.
73e415a2 »
2012-02-06 Address ticket #180 here since that problem is so hard to discover wh…
374
abc01bce »
2011-05-18 [doc] Update README.md to reflect the new HTTPS to HTTP proxy capabil…
375 ## Using node-http-proxy from the command line
376 When you install this package with npm, a node-http-proxy binary will become available to you. Using this binary is easy with some simple options:
377
378 ``` js
379 usage: node-http-proxy [options]
380
381 All options should be set with the syntax --option=value
382
383 options:
384 --port PORT Port that the proxy server should run on
385 --target HOST:PORT Location of the server the proxy will target
386 --config OUTFILE Location of the configuration file for the proxy server
387 --silent Silence the log output from the proxy server
388 -h, --help You're staring at it
389 ```
390
c06f4bf7 »
2010-11-21 [test doc api] Added forward proxy functionality with tests
391 <br/>
abc01bce »
2011-05-18 [doc] Update README.md to reflect the new HTTPS to HTTP proxy capabil…
392 ## Why doesn't node-http-proxy have more advanced features like x, y, or z?
b1eb13eb »
2010-07-27 added createServer but hated it, gonna remove
393
bd6a2622 »
2011-04-17 [doc] Update README.md
394 If you have a suggestion for a feature currently not supported, feel free to open a [support issue][6]. node-http-proxy is designed to just proxy http requests from one server to another, but we will be soon releasing many other complimentary projects that can be used in conjunction with node-http-proxy.
395
396 ## Run Tests
abc01bce »
2011-05-18 [doc] Update README.md to reflect the new HTTPS to HTTP proxy capabil…
397 The test suite is designed to fully cover the combinatoric possibilities of HTTP and HTTPS proxying:
398
399 1. HTTP --> HTTP
400 2. HTTPS --> HTTP
401 3. HTTPS --> HTTPS
402 4. HTTP --> HTTPS
ab8c264e »
2011-05-17 add spacing around code blocks to fix README rendering
403
d5b9ba71 »
2011-05-17 don't highlight non-javascript as javascript
404 ```
28f6dc15 »
2011-05-17 format markdown for syntax highlighting on GitHub
405 vows test/*-test.js --spec
406 vows test/*-test.js --spec --https
abc01bce »
2011-05-18 [doc] Update README.md to reflect the new HTTPS to HTTP proxy capabil…
407 vows test/*-test.js --spec --https --target=https
408 vows test/*-test.js --spec --target=https
28f6dc15 »
2011-05-17 format markdown for syntax highlighting on GitHub
409 ```
341bbd40 »
2010-07-27 updating docs
410
a9084b92 »
2010-09-09 [api test dist doc] Updated for 0.3.0 release
411 <br/>
341bbd40 »
2010-07-27 updating docs
412 ### License
413
414 (The MIT License)
415
9128a8c5 »
2010-09-19 [doc] Updated Copyright ... added Fedor
416 Copyright (c) 2010 Charlie Robbins, Mikeal Rogers, Fedor Indutny, & Marak Squires
85f73723 »
2010-07-27 initial release v0.1.0, sure to have many updates coming.
417
418 Permission is hereby granted, free of charge, to any person obtaining
419 a copy of this software and associated documentation files (the
420 "Software"), to deal in the Software without restriction, including
421 without limitation the rights to use, copy, modify, merge, publish,
422 distribute, sublicense, and/or sell copies of the Software, and to
423 permit persons to whom the Software is furnished to do so, subject to
424 the following conditions:
425
426 The above copyright notice and this permission notice shall be
427 included in all copies or substantial portions of the Software.
428
429 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
430 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
431 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
432 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
433 LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
434 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
435 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
6661753f »
2010-09-02 [doc] added nodejitsu.com link to ReadMe. http-proxy is used in our f…
436
57153182 »
2011-03-10 [doc api test] Wrap things up for v0.4.0 release: Add hostnameOnly ro…
437 [0]: http://nodejitsu.com
7fa6599f »
2012-03-13 Making README links consistent with latest project structure.
438 [1]: https://github.com/nodejitsu/node-http-proxy/blob/master/examples/websocket/websocket-proxy.js
439 [2]: https://github.com/nodejitsu/node-http-proxy/blob/master/examples/http/proxy-https-to-http.js
440 [3]: https://github.com/nodejitsu/node-http-proxy/tree/master/examples
212009df »
2011-04-17 [doc api] Update README.md and CHANGELOG.md for v0.5.0. Update bin/no…
441 [4]: http://www.ietf.org/rfc/rfc2616.txt
bd6a2622 »
2011-04-17 [doc] Update README.md
442 [5]: http://socket.io
332d2d78 »
2011-05-17 fix syntax error in README example
443 [6]: http://github.com/nodejitsu/node-http-proxy/issues
Something went wrong with that request. Please try again.