Skip to content

Instantly share code, notes, and snippets.

@mmalecki
Created January 2, 2012 16:54
Show Gist options
  • Select an option

  • Save mmalecki/1551356 to your computer and use it in GitHub Desktop.

Select an option

Save mmalecki/1551356 to your computer and use it in GitHub Desktop.
New `haibu-carapace` API
var fork = require('child_process').fork;
var c = fork('bin/carapace', ['examples/chroot-jail/server.js']);
c.on('message', function (data) {
console.log('Received a message from carapace');
console.dir(data);
if (data.event == 'port') {
console.log([
'Server is listening on port ' + data.data.port,
'(It wanted to listen on ' + data.data.desired + ')'
].join('\n'));
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment