From 4c8e1d96a36523a548959415903bc669ebcc138d Mon Sep 17 00:00:00 2001 From: yawnt Date: Sun, 14 Oct 2012 19:36:02 +0200 Subject: [PATCH 1/3] [docs] options --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.md b/README.md index 4390fb3..1cb4ba5 100644 --- a/README.md +++ b/README.md @@ -478,6 +478,33 @@ options: 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. +## Options + +### Http Proxy + +Http Proxy supports the following options + +```javascript +{ + forward: { // options for forward-proxy + port: 8000, + host: 'staging.com' + target : { // options for proxy target + port: 8000, + host: 'localhost' + } + source : { // additional options for websocket proxying + host : 'localhost', + port : 8000, + https: true + } + enable : { + xforward: true // enables X-Forwarded-For + } + changeOrigin: false // changes the origin of the host header to the target URL +} +``` + ## Run Tests The test suite is designed to fully cover the combinatoric possibilities of HTTP and HTTPS proxying: From d4cb9dad6ce36a823c9e8970e0bb3266d844e536 Mon Sep 17 00:00:00 2001 From: yawnt Date: Sun, 14 Oct 2012 20:25:19 +0200 Subject: [PATCH 2/3] [docs] more options --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 1cb4ba5..12ed10b 100644 --- a/README.md +++ b/README.md @@ -489,19 +489,20 @@ Http Proxy supports the following options forward: { // options for forward-proxy port: 8000, host: 'staging.com' + }, target : { // options for proxy target - port: 8000, - host: 'localhost' - } + port : 8000, + host : 'localhost', + }; source : { // additional options for websocket proxying host : 'localhost', port : 8000, https: true - } + }, enable : { xforward: true // enables X-Forwarded-For - } - changeOrigin: false // changes the origin of the host header to the target URL + }, + changeOrigin: false, // changes the origin of the host header to the target URL } ``` From 213e03c99844c5c984fbf857bae32095165a1e8f Mon Sep 17 00:00:00 2001 From: yawnt Date: Mon, 15 Oct 2012 20:58:30 +0200 Subject: [PATCH 3/3] [fix] function --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 12ed10b..fdedc3a 100644 --- a/README.md +++ b/README.md @@ -482,7 +482,7 @@ If you have a suggestion for a feature currently not supported, feel free to ope ### Http Proxy -Http Proxy supports the following options +`createServer()` supports the following options ```javascript {