* String: new path, for example `cookiePathRewrite: "/newPath/"`. To remove the path, use `cookiePathRewrite: ""`. To set path to root use `cookiePathRewrite: "/"`.
366
366
* 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:
368
368
```
369
369
cookiePathRewrite: {
370
370
"/unchanged.path/": "/unchanged.path/",
@@ -376,7 +376,7 @@ proxyServer.listen(8015);
376
376
* **proxyTimeout**: timeout (in millis) for outgoing proxy requests
377
377
* **timeout**: timeout (in millis) for incoming requests
378
378
* **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
380
380
* **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:
381
381
382
382
```
@@ -486,12 +486,15 @@ proxy.close();
486
486
487
487
### Miscellaneous
488
488
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
0 commit comments