You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The http-proxy was recently updated with many features and bug fixes.
This commit brings in the latest version and updates the README.md file
with new (and missing) options.
Copy file name to clipboardExpand all lines: README.md
+34
Original file line number
Diff line number
Diff line change
@@ -309,6 +309,7 @@ The following options are provided by the underlying [http-proxy](https://github
309
309
* **option.ignorePath**: true/false, Default: false - specify whether you want to ignore the proxy path of the incoming request (note: you will have to append / manually if required).
310
310
* **option.localAddress** : Local interface string to bind for outgoing connections
311
311
* **option.changeOrigin**: true/false, Default: false - changes the origin of the host header to the target URL
312
+
* **option.preserveHeaderKeyCase**: true/false, Default: false - specify whether you want to keep letter case of response header key
312
313
* **option.auth** : Basic authentication i.e. 'user:password' to compute an Authorization header.
313
314
* **option.hostRewrite**: rewrites the location hostname on (301/302/307/308) redirects.
314
315
* **option.autoRewrite**: rewrites the location host/port on (301/302/307/308) redirects based on requested host/port. Default: false.
@@ -325,8 +326,41 @@ The following options are provided by the underlying [http-proxy](https://github
325
326
"*":""
326
327
}
327
328
```
329
+
* **option.cookiePathRewrite**: rewrites path of `set-cookie` headers. Possible values:
330
+
* `false` (default): disable cookie rewriting
331
+
* String: new path, for example `cookiePathRewrite:"/newPath/"`. To remove the path, use `cookiePathRewrite:""`. To set path to root use `cookiePathRewrite:"/"`.
332
+
* Object: mapping of paths to new paths, use `"*"` to match all paths.
333
+
For example, to keep one path unchanged, rewrite one path and remove other paths:
* **option.proxyTimeout**: timeout (in millis) when proxy receives no response from target
343
+
* **option.timeout**: timeout (in millis) for incoming requests
344
+
* **option.followRedirects**: true/false, Default: false - specify whether you want to follow redirects
345
+
* **option.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
346
+
* **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:
0 commit comments