I have answered a variation of "how to terminate a HTTP server" many times on different [tag:node.js] support channels. Unfortunately, I couldn't recommend any of the existing libraries because they are lacking in one or another way. I have since put together a package that (I believe) is handling all the cases expected of graceful HTTP server termination.https://github.com/gajus/http-terminatorThe main benefit of http-terminator is that:it does not monkey-patch Node.js APIit immediately destroys all sockets without an attached HTTP requestit allows graceful timeout to sockets with ongoing HTTP requestsit properly handles HTTPS connectionsit informs connections using keep-alive that server is shutting down by setting a connection: close headerit does not terminate the Node.js process
Submitted January 20, 2020 at 02:45AM by gajus0
No comments:
Post a Comment