Skip to content
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

Possible connection leakage #1582

Open
azhuchkov opened this issue Apr 29, 2022 · 3 comments
Open

Possible connection leakage #1582

azhuchkov opened this issue Apr 29, 2022 · 3 comments

Comments

@azhuchkov
Copy link

After migrating from node.js v10.24.1 to v16.14.2, encountered some weird behaviour: different applications report connection troubles, something like no buffer space available. Also my application which uses Server Sent Events (SSE) stopped detect SSE channel disconnects (which is proxied under the hood).

The workaround looks like:

onProxyReq: (proxyReq, req, res) => {
    proxyReq.on('close', () => res.end());
}

Some more context:

  1. macOS,
  2. nvm 0.39.1,
  3. create-react-app,
  4. http-proxy-middleware 2.0.6,
  5. http-proxy 1.17.8.
@Jimbly
Copy link
Contributor

Jimbly commented Jul 5, 2022

There absolutely is a leak, due to nodejs/node#41117 , and a workaround is available in #1559 and pushed to NPM as http-proxy-node16.

@vanesca88
Copy link

vanesca88 commented Feb 7, 2023

The fix helped me as well. Thank you :D

@cassepipe
Copy link

cassepipe commented Apr 17, 2023

I am using vite and trying to use Server Sent Events. Is this what's responsible for the following error you think ? :

{"statusCode":403,"message":"sse already opened","error":"Forbidden"}

Edit: From what I have read, I guess not since I have node v19+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants