Skip to content

Commit b5d5eaa

Browse files
committed
[doc] note in readme about middleware
1 parent d3c0697 commit b5d5eaa

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

+10
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,16 @@ https.createServer(options.https, function (req, res) {
312312
res.end();
313313
}).listen(8000);
314314
```
315+
## Middleware
316+
317+
`node-http-proxy` now supports connect middleware. Add middleware functions to your createServer call:
318+
319+
``` js
320+
httpProxy.createServer(
321+
require('connect-gzip').gzip(),
322+
9000, 'localhost'
323+
).listen(8000);
324+
```
315325

316326
## Proxying WebSockets
317327
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

Comments
 (0)