unix-socket-credentials
Get the uid, gid and pid of a client that connects to your unix socket server
Last updated 13 years ago by spion .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install unix-socket-credentials 
SYNC missed versions from official npm registry.

node-unix-socket-credentials

Get the uid, gid and pid of a client that connects to your node.js unix socket server

Writing multi-user system services in node has suddenly become much easier!

install

From npm

npm install unix-socket-credentials

usage

Sync and async methods are provided:

Full async example:

var uscred = require('unix-socket-credentials');

var s = net.createServer('/tmp/test.sock', function(cli) {
    uscred.getCredentials(cli, function(err, res) {
        // You can now use the uid/gid/pid of the client process
        console.log(res.uid, res.gid, res.pid);
    });
});

Shortened sync example:

var res = uscred.getCredentialsSync(cli);
console.log(res.uid, res.gid, res.pid);

licence

MIT

Current Tags

  • 0.1.3                                ...           latest (13 years ago)

3 Versions

  • 0.1.3                                ...           13 years ago
  • 0.1.2                                ...           13 years ago
  • 0.1.1                                ...           13 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 2
Last Month 1
Dependencies (3)
Dev Dependencies (1)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |