zsock

2.0.1 • Public • Published

node-zsock is a very small library specific to Sun derived operating systems (i.e., illumos). This library allows a node server running in the Global Zone to open Unix Domain Sockets in other zones, safely, under the same FS path in each zone. By using this mechanism, you can enable IPC across zones.

Usage

The library is very simple, and small, and only exposes you the ability to create a new fd socket that can be used with the existing node net API:

var zsock = require('zsock');
zsock.createZoneSocket({
  zone: 'foo',
  path: '/tmp/sock'
}, function(err, fd) {
  if (err) throw err;

  var server = net.createServer(function(c) {
    c.write('hello from the global zone...\r\n');
    c.pipe(c);
  });

  server.listenFD(fd);
});

Note that this API creates a STREAM socket (i.e., there's no datagram support). But that seems to be the general case in node anyway.

Installation

npm install zsock

(You can also install it by doing node-waf configure build and then linking or copying the folder into your project's node_modules directory.)

License

MIT. 'Nuff said.

Bugs

See https://github.com/mcavage/node-zsock/issues.

Readme

Keywords

none

Package Sidebar

Install

npm i zsock

Weekly Downloads

20

Version

2.0.1

License

none

Unpacked Size

145 kB

Total Files

9

Last publish

Collaborators

  • bahamat
  • todd.whiteman
  • kusor
  • michael.hicks
  • trentm
  • dap
  • jclulow
  • arekinath
  • melloc
  • kellymclaughlin