[dist] doc updates

This commit is contained in:
Jarrett Cruger 2018-04-20 11:33:35 -04:00 committed by Charlie Robbins
parent 4a37175a52
commit e94d52973a

View File

@ -364,7 +364,7 @@ proxyServer.listen(8015);
* `false` (default): disable cookie rewriting * `false` (default): disable cookie rewriting
* String: new path, for example `cookiePathRewrite: "/newPath/"`. To remove the path, use `cookiePathRewrite: ""`. To set path to root use `cookiePathRewrite: "/"`. * String: new path, for example `cookiePathRewrite: "/newPath/"`. To remove the path, use `cookiePathRewrite: ""`. To set path to root use `cookiePathRewrite: "/"`.
* Object: mapping of paths to new paths, use `"*"` to match all paths. * Object: mapping of paths to new paths, use `"*"` to match all paths.
For example keep one path unchanged, rewrite one path and remove other paths: For example, to keep one path unchanged, rewrite one path and remove other paths:
``` ```
cookiePathRewrite: { cookiePathRewrite: {
"/unchanged.path/": "/unchanged.path/", "/unchanged.path/": "/unchanged.path/",
@ -376,7 +376,7 @@ proxyServer.listen(8015);
* **proxyTimeout**: timeout (in millis) for outgoing proxy requests * **proxyTimeout**: timeout (in millis) for outgoing proxy requests
* **timeout**: timeout (in millis) for incoming requests * **timeout**: timeout (in millis) for incoming requests
* **followRedirects**: true/false, Default: false - specify whether you want to follow redirects * **followRedirects**: true/false, Default: false - specify whether you want to follow redirects
* **selfHandleRequest** true/false, if set to true, none of the webOutgoing passes are called and its your responsibility ro appropriately return the response by listening and acting on the `proxyRes` event * **selfHandleResponse** true/false, if set to true, none of the webOutgoing passes are called and it's your responsibility to appropriately return the response by listening and acting on the `proxyRes` event
* **buffer**: stream of data to send as the request body. Maybe you have some middleware that consumes the request stream before proxying it on e.g. If you read the body of a request into a field called 'req.rawbody' you could restream this field in the buffer option: * **buffer**: stream of data to send as the request body. Maybe you have some middleware that consumes the request stream before proxying it on e.g. If you read the body of a request into a field called 'req.rawbody' you could restream this field in the buffer option:
``` ```
@ -486,12 +486,15 @@ proxy.close();
### Miscellaneous ### Miscellaneous
If you want to handle your own response after receiving the proxyRes, you can do If you want to handle your own response after receiving the `proxyRes`, you can do
so with `selfHandleResponse` so with `selfHandleResponse`. As you can see below, if you use this option, you
are able to intercept and read the `proxyRes` but you must also make sure to
reply to the `res` itself otherwise the original client will never receive any
data.
### Modify response ### Modify response
``` ```js
var option = { var option = {
target: target, target: target,