We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Recently I bumped into the issue where my library (that uses this) was hanging after termination.
Debugging showed event loop was filled with TLSWrap and socket calls which led me to connection timeouts and to these lines:
TLSWrap
node-http-mitm-proxy/lib/proxy.ts
Lines 1099 to 1102 in 310a3bc
error event does not include timeout, so even after clients give up and close connection (ClientToProxy), these were left hanging.
error
timeout
Google led me to https://stackoverflow.com/a/55021202 and I've added
ctx.proxyToServerRequest.on("error", self._onError.bind(self, "PROXY_TO_SERVER_REQUEST_ERROR", ctx)); + ctx.proxyToServerRequest.on("timeout", () => {ctx.proxyToServerRequest.destroy()});
The destroy() is now triggering on timeout and then triggering the previously set error handler.
destroy()
I haven't opened a PR with this as I'm not sure of its impact, leaving this up as an issue 😄
Calling destroy() on the http agents also destroys all open sockets and properly allows termination.
Currently doing this when calling Proxy.close()
Proxy.close()
The text was updated successfully, but these errors were encountered:
same issue here
Sorry, something went wrong.
No branches or pull requests
Recently I bumped into the issue where my library (that uses this) was hanging after termination.
Debugging showed event loop was filled with
TLSWrap
and socket calls which led me to connection timeouts and to these lines:node-http-mitm-proxy/lib/proxy.ts
Lines 1099 to 1102 in 310a3bc
error
event does not includetimeout
, so even after clients give up and close connection (ClientToProxy), these were left hanging.Google led me to https://stackoverflow.com/a/55021202 and I've added
The
destroy()
is now triggering on timeout and then triggering the previously set error handler.I haven't opened a PR with this as I'm not sure of its impact, leaving this up as an issue 😄
Calling destroy() on the http agents also destroys all open sockets and properly allows termination.
Currently doing this when calling
Proxy.close()
The text was updated successfully, but these errors were encountered: