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
Copy file name to clipboardExpand all lines: README.md
+20-21Lines changed: 20 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,18 +7,17 @@
7
7
8
8
Node.js proxying made simple. Configure proxy middleware with ease for [connect](https://github.com/senchalabs/connect), [express](https://github.com/expressjs/express), [next.js](https://github.com/vercel/next.js) and [many more](#compatible-servers).
9
9
10
-
Powered by the popular Nodejitsu [`http-proxy`](https://github.com/http-party/node-http-proxy). [](https://github.com/http-party/node-http-proxy)
10
+
Powered by [`httpxy`](https://github.com/unjs/httpxy). A maintained version of [http-proxy](https://github.com/http-party/node-http-proxy).
11
11
12
12
## ⚠️ Note <!-- omit in toc -->
13
13
14
-
This page is showing documentation for version v3.x.x ([release notes](https://github.com/chimurai/http-proxy-middleware/releases))
14
+
This page is showing documentation for version **v4.x.x** ([release notes](https://github.com/chimurai/http-proxy-middleware/releases))
15
15
16
-
See [MIGRATION.md](https://github.com/chimurai/http-proxy-middleware/blob/master/MIGRATION.md) for details on how to migrate from v2.x.x to v3.x.x
_All_`http-proxy`[options](https://github.com/nodejitsu/node-http-proxy#options) can be used, along with some extra `http-proxy-middleware`[options](#options).
50
+
_All_`httpxy`[options](https://github.com/unjs/httpxy#options) can be used, along with some extra `http-proxy-middleware`[options](#options).
-**option.on.open**: function, subscribe to http-proxy's `open` event.
377
+
-**option.on.open**: function, subscribe to httpxy's `open` event.
379
378
380
379
```javascript
381
380
functiononOpen(proxySocket) {
@@ -384,7 +383,7 @@ createProxyMiddleware({
384
383
}
385
384
```
386
385
387
-
-**option.on.close**: function, subscribe to http-proxy's `close` event.
386
+
-**option.on.close**: function, subscribe to httpxy's `close` event.
388
387
389
388
```javascript
390
389
functiononClose(res, socket, head) {
@@ -393,9 +392,9 @@ createProxyMiddleware({
393
392
}
394
393
```
395
394
396
-
## `http-proxy` options
395
+
## `httpxy` options
397
396
398
-
The following options are provided by the underlying [http-proxy](https://github.com/nodejitsu/node-http-proxy#options) library.
397
+
The following options are provided by the underlying [httpxy](https://github.com/unjs/httpxy#options) library.
399
398
400
399
-**option.target**: url string to be parsed with the url module
401
400
-**option.forward**: url string to be parsed with the url module
@@ -450,10 +449,10 @@ The following options are provided by the underlying [http-proxy](https://github
450
449
- **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:
451
450
452
451
```javascript
453
-
import httpProxy from 'http-proxy';
452
+
import { createProxyServer } from 'httpxy';
454
453
import streamify from 'stream-array';
455
454
456
-
const proxy = httpProxy.createProxyServer();
455
+
const proxy = createProxyServer();
457
456
458
457
export default function proxyWithBody(req, res, next) {
0 commit comments