Socket
Socket
Sign inDemoInstall

connections

Package Overview
Dependencies
0
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    connections

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


Version published
Weekly downloads
226
increased by209.59%
Maintainers
2
Install size
4.62 kB
Created
Weekly downloads
 

Readme

Source

connections

Keeps track of connections to an http or tcp server (or any other server object with the same api) 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')(serverInstance)

You can also pass an array of server instances

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.on('connection', function (socket) {})

forwarded event from the server or servers

connections.sockets

an array of open sockets (http clients)

connections.destroy()

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

connections.add(socket)

manually add a socket to the connection list

FAQs

Last updated on 20 Feb 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc