Skip to content

Commit e94d529

Browse files
jcrugzzindexzero
authored andcommitted
[dist] doc updates
1 parent 4a37175 commit e94d529

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Diff for: README.md

+8-5
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ proxyServer.listen(8015);
364364
* `false` (default): disable cookie rewriting
365365
* String: new path, for example `cookiePathRewrite: "/newPath/"`. To remove the path, use `cookiePathRewrite: ""`. To set path to root use `cookiePathRewrite: "/"`.
366366
* Object: mapping of paths to new paths, use `"*"` to match all paths.
367-
For example keep one path unchanged, rewrite one path and remove other paths:
367+
For example, to keep one path unchanged, rewrite one path and remove other paths:
368368
```
369369
cookiePathRewrite: {
370370
"/unchanged.path/": "/unchanged.path/",
@@ -376,7 +376,7 @@ proxyServer.listen(8015);
376376
* **proxyTimeout**: timeout (in millis) for outgoing proxy requests
377377
* **timeout**: timeout (in millis) for incoming requests
378378
* **followRedirects**: true/false, Default: false - specify whether you want to follow redirects
379-
* **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
379+
* **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
380380
* **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:
381381
382382
```
@@ -486,12 +486,15 @@ proxy.close();
486486

487487
### Miscellaneous
488488

489-
If you want to handle your own response after receiving the proxyRes, you can do
490-
so with `selfHandleResponse`
489+
If you want to handle your own response after receiving the `proxyRes`, you can do
490+
so with `selfHandleResponse`. As you can see below, if you use this option, you
491+
are able to intercept and read the `proxyRes` but you must also make sure to
492+
reply to the `res` itself otherwise the original client will never receive any
493+
data.
491494

492495
### Modify response
493496

494-
```
497+
```js
495498

496499
var option = {
497500
target: target,

0 commit comments

Comments
 (0)