@atsushi_suzuki/http-graceful-close

0.0.2 • Public • Published

http-graceful-close

gracefully close http server with keep-alive connections.

API

var gracefulHttp = require('http-graceful-close');

gracefulHttp.install(server: http.Server)

Install Server.gracefulClose to given server instance.

This must be called before first listen.

gracefulHttp.createServer(listener: Function): http.Server

new gracefulHttp.Server(options: Object)

Wrapper of http methods.

server.gracefulClose(listener?: Function)

  1. Close listening socket by Server.close
  2. If there is request with headers not sent, set Connection: close
  3. Or wait for 400ms timeout and destroy connection

Package Sidebar

Install

npm i @atsushi_suzuki/http-graceful-close

Weekly Downloads

1

Version

0.0.2

License

ISC

Last publish

Collaborators

  • atsushi_suzuki