http-proxy-middleware
http-proxy-middleware copied to clipboard
Many on onOpen But only one onClose
trafficstars
yarn why http-proxy-middleware OR npm ls http-proxy-middleware output (mask private folder names with *****)
[email protected]
- [X] I understand project setup issues should be asked on StackOverflow or in GitHub Discussions.
- [X] I updated to latest
http-proxy-middleware.
Describe the bug (be clear and concise)
If I proxy ws Set the callback with CreateProxyMiddleware
{ onClose: function (){ console.log("onClose"); }, onProxyReqWs: function(){ console.log("onProxyReqWs"); }, onOpen: function(){ console.log("onOpen"); } }
can receive many onProxyReqWs and onOpen but only receive one onClose event. and the result is Socket object will leak, memory increase。
Step-by-step reproduction instructions
1. ...
2. ...
Expected behavior (be clear and concise)
...
What http-proxy-middleware configuration are you using?
function GetProxyParam(){
var reg = `^/${Config.http_stream_port}`;
var rewrite = {};
rewrite[reg] = "";
return {
target: `http://localhost:${Config.http_stream_port}`,
changeOrigin: true,
ws: true,
logLevel: "debug",
pathRewrite: rewrite,
onClose: function (){
console.log("onClose");
},
onProxyReqWs: function(){
console.log("onProxyReqWs");
},
onOpen: function(){
console.log("onOpen");
}
}
}
What OS/version and node/version are you seeing the problem?
windows node v12.20.1
Additional context (optional)
...
Can you please provide a minimal example and reproducible steps for investigation.
Same as: https://github.com/http-party/node-http-proxy/issues/1510 Maybe is a node-http-proxy bug