clients-node

0.0.1 • Public • Published

clients-node

Adds app.clients to Expressjs showing recently connected clients

app.js

    var express = require('express'), app = express();
    var server = require('http').createServer(app)
  server.listen(85);
 
  require('./clients-node.js')(app, timeoutsec=5);
  // app.clients is a list of recently connected clients
 
  app.get('/', function(r,s){
  // show clients list
  s.send(app.clients)
  })
 
  // In 10 seconds, the clients should be gone from the list
  setTimeout(function(){console.log(app.clients)}, 10000)

Readme

Keywords

none

Package Sidebar

Install

npm i clients-node

Weekly Downloads

3

Version

0.0.1

License

none

Last publish

Collaborators

  • dpweb