-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create proxy instance for each request #65
Conversation
build(deps-dev): bump next from 11.1.3 to 12.1.0
According to [the doc](https://www.npmjs.com/package/http-proxy#listening-for-proxy-events) the `proxyReq` event gets ```http.ClientRequest proxyReq, http.IncomingMessage req, http.ServerResponse res, Object options)``` I just fixed the name of the first parameter
Updated README for the proxyReq signature
docs: add dariosky as a contributor for doc
Thanks for your PR I understood the memory leak you are talking about. However, even after this PR is merged, each instance bound to the event is still in memory, so memory leak is likely. Let's find another way to solve this memory leak problem. |
@all-contributors please add @johannbrynjar for bug |
I've put up a pull request to add @johannbrynjar! 🎉 |
@johannbrynjar |
There was a mistake. Your PR seems fine. Even if the event is bound to the instance, it will be removed from memory by GC when the scope is closed. |
@all-contributors please add @johannbrynjar for code |
I've put up a pull request to add @johannbrynjar! 🎉 |
Global proxy instance make memory leak. So I would like to create proxy for each request.
Every request init proxy so each request add new events:
next-http-proxy-middleware/src/index.ts
Line 65 in 2453215
Also here for each request the code add new event listener:
next-http-proxy-middleware/src/index.ts
Line 89 in 2453215
I think this issue #25 is related to this pull request.