Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

server-graceful-shutdown

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

server-graceful-shutdown - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

12

index.js

@@ -5,9 +5,9 @@ module.exports = enableGracefulShutdown;

server.socketIdleTimeout = socketIdleTimeout || 10000;
var connections = {};
server.activeConnections = {};
server.on('connection', function(conn) {
var key = conn.remoteAddress + ':' + conn.remotePort;
connections[key] = conn;
server.activeConnections[key] = conn;
conn.on('close', function() {
delete connections[key];
delete server.activeConnections[key];
});

@@ -18,5 +18,5 @@ });

server.close(cb);
for (var key in connections) {
connections[key].setTimeout(server.socketIdleTimeout, function() {
connections[key].destroy();
for (var key in server.activeConnections) {
server.activeConnections[key].setTimeout(server.socketIdleTimeout, function() {
server.activeConnections[key].destroy();
});

@@ -23,0 +23,0 @@ }

{
"name": "server-graceful-shutdown",
"version": "0.1.0",
"version": "0.1.1",
"description": "Graceful shutdown for node http(s) servers.",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc