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
+11
Original file line number
Diff line number
Diff line change
@@ -43,6 +43,7 @@ There are several ways to use node-http-proxy; the library is designed to be fle
43
43
3. In conjunction with a Proxy Routing Table
44
44
4. As a forward-proxy with a reverse proxy
45
45
5. From the command-line as a long running process
46
+
6. customized with 3rd party middleware.
46
47
47
48
In each of these scenarios node-http-proxy can handle any of these types of requests:
48
49
@@ -312,6 +313,16 @@ https.createServer(options.https, function (req, res) {
312
313
res.end();
313
314
}).listen(8000);
314
315
```
316
+
## Middleware
317
+
318
+
`node-http-proxy` now supports connect middleware. Add middleware functions to your createServer call:
319
+
320
+
```js
321
+
httpProxy.createServer(
322
+
require('connect-gzip').gzip(),
323
+
9000, 'localhost'
324
+
).listen(8000);
325
+
```
315
326
316
327
## Proxying WebSockets
317
328
Websockets are handled automatically when using the `httpProxy.createServer()`, but if you want to use it in conjunction with a stand-alone HTTP + WebSocket (such as [socket.io][5]) server here's how:
0 commit comments