0.1.3 • Published 11 years ago

unix-socket-credentials v0.1.3

Weekly downloads
4
License
-
Repository
github
Last release
11 years ago

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

0.1.3

11 years ago

0.1.2

11 years ago

0.1.1

11 years ago