Skip to content

Commit 1df2b30

Browse files
committed
Merge pull request #315 from yawnt/options-doc
documentation for options
2 parents 2e7d8a8 + 213e03c commit 1df2b30

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

Diff for: README.md

+28
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,34 @@ options:
478478

479479
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.
480480

481+
## Options
482+
483+
### Http Proxy
484+
485+
`createServer()` supports the following options
486+
487+
```javascript
488+
{
489+
forward: { // options for forward-proxy
490+
port: 8000,
491+
host: 'staging.com'
492+
},
493+
target : { // options for proxy target
494+
port : 8000,
495+
host : 'localhost',
496+
};
497+
source : { // additional options for websocket proxying
498+
host : 'localhost',
499+
port : 8000,
500+
https: true
501+
},
502+
enable : {
503+
xforward: true // enables X-Forwarded-For
504+
},
505+
changeOrigin: false, // changes the origin of the host header to the target URL
506+
}
507+
```
508+
481509
## Run Tests
482510
The test suite is designed to fully cover the combinatoric possibilities of HTTP and HTTPS proxying:
483511

0 commit comments

Comments
 (0)