gracefully close open sockets in a http server
http-close keeps track on open sockets and closes them gracefully when the tcp server is closeing.
When you call
server.close() this moudule will:
Connection: closeto http requests where the headers is not sent
When a socket timeouts after the server is closed, this module will respond with a 500 status code and end the connection where the headers is not sent. All other sockets will be destroyed.
var http =httpClose =var server = http// Add http-close hook// Just call server.close as usual when you want to stop the serverserver
$ npm install http-close