-
Notifications
You must be signed in to change notification settings - Fork 131
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
Enable keep-alive, --keep-alive-timeout
flag added (default: 5000ms)
#492
Conversation
to see if it improves performance. Idea from http-party/node-http-proxy#1058 [docs](https://nodejs.org/api/http.html#new-agentoptions)
for more information, see https://pre-commit.ci
so we have keep-alive on both sides
I don't understand the details well enough to review this. Are there two connections to consider (or more, or something else)? The connection initiated to the proxy (A->proxy), and the one the proxy initiated to some destination (proxy->B)? Is "agent" associated with the connection towards the proxy, and "server" associated with the connection from the proxy onwards to some destination? |
Yes, both of these. The If any of the 4 entities involved (the client, the proxy's http server, the proxy's http client, or the upstream server) don't ask for the socket to be kept alive, then the connection will be closed.
|
ea3f6cd
to
84abbae
Compare
--keep-alive-timeout
added, defaulting to 5000ms
--keep-alive-timeout
added, defaulting to 5000ms--keep-alive-timeout
flag added (default: 5000ms)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for helping me understand this better, I think I understand it well enough to dare agree this makes sense and merge given that this LGTM!
extends #481 to enable keepAlive not just on the server, but on proxied requests as well via an http agent, and exposing timeout on the command-line.
alternative to #491 using the standard library
closes #481
closes #491