mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
[doc] note in readme about middleware
This commit is contained in:
parent
d3c06973a1
commit
b5d5eaabab
10
README.md
10
README.md
@ -312,6 +312,16 @@ https.createServer(options.https, function (req, res) {
|
||||
res.end();
|
||||
}).listen(8000);
|
||||
```
|
||||
## Middleware
|
||||
|
||||
`node-http-proxy` now supports connect middleware. Add middleware functions to your createServer call:
|
||||
|
||||
``` js
|
||||
httpProxy.createServer(
|
||||
require('connect-gzip').gzip(),
|
||||
9000, 'localhost'
|
||||
).listen(8000);
|
||||
```
|
||||
|
||||
## Proxying WebSockets
|
||||
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:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user