TooTallNate / proxy-agents

Node.js HTTP Proxy Agents Monorepo
https://proxy-agents.n8.io
873 stars 228 forks source link

Terminates with exit status 0 on NodeJS 14+ after first or second (maximum) request #139

Closed danilvalov closed 1 year ago

danilvalov commented 1 year ago

Environment: NodeJS v.14.17.0, v.14.19.1, v.16.17.0, OS: Ubuntu, MacOS

Library version: v.5.0.0 and v.5.0.1 (both tested)

I don't know what happened. But when I try to send 1+ requests using NodeJS v.14+ (I tested on v.14.17.0, v.14.19.1, v.16.17.0, ubuntu, macos), my application terminates with exit status 0 (like using process.exit(0);) without any errors.

The problem is like in this issue: https://github.com/TooTallNate/node-https-proxy-agent/issues/52 (the same symptoms in debug logs). But I use working and stable http proxy server.

Sometimes I can get response on first or second requests. But it stops my app anyway after first or second request for sure.

This library works correctly when I downgrade NodeJS to v.10 or v.12. But it doesn't work on NodeJS 14+.

I saw the fix for this library v.5.0.1 for NodeJS 14 compatibility. But it doesn't work for me. I tested on v.5.0.0 and v.5.0.1 (both). I see the same problem.

danilvalov commented 1 year ago

I fixed it changing this library to node-http-proxy-agent. But this library worked correctly with http proxy until NodeJS 12 inclusive