connections

Keeps track of connections to an http server and provides a way to close connections

npm install connections
27 downloads in the last day
157 downloads in the last week
287 downloads in the last month

connections

Keeps track of connections to an http server and provides a way to close connections

By default, require('http').createServer provides no mechanism for tracking client connections and/or closing client connections

NPM

usage

var connections = require('connections')(httpServerInstance)

connections has .sockets and .destroy

connections.on('idle', function() {})

called whenever all active connections have closed

connections.on('close', function(socket) {})

called whenever a socket closes

connections.sockets

an array of open sockets (http clients)

connections.destroy()

destroys/closes all active connections (calls .destroy() on each socket)

npm loves you