How to use the node-ipc.serveNet function in node-ipc

To help you get started, we’ve selected a few node-ipc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Mostafa-Samir / klyng / tests / fixtures / beacon / fake-tcp-server.js View on Github external
var ipc = require('node-ipc');
var crypto = require('crypto');
var cs = require('../../../lib/crypto-service');

ipc.config.silent = true;

var password = "a1b2c3d4";
var secret = "";

ipc.serveNet('127.0.0.1', 4895, function() {

    ipc.server.on('PROBE:MSG', function(data, socket) {
        ipc.server.emit(socket, "ALIVE:MSG", {});
    });

    ipc.server.on('MONITOR:MSG', function(msg, socket) {
        console.log(msg.data.line);
        socket.destroy();
        ipc.server.stop();
    });

    ipc.server.on('KLYNG:MSG', function(msg, socket) {
        console.log(msg.data);
        socket.destroy();
        ipc.server.stop();
    });
github Mostafa-Samir / klyng / tests / fixtures / beacon / fake-remote-parent.js View on Github external
var ipc = require('node-ipc');

ipc.config.silent = true;

ipc.serveNet('127.0.0.1', 4895, function() {
    ipc.server.on('MONITOR:MSG', function(msg, socket) {
        console.log(msg.data.line);
        socket.destroy();
        ipc.server.stop();
    });

    ipc.server.on('KLYNG:MSG', function(msg, socket) {
        console.log(msg.data);
        socket.destroy();
        ipc.server.stop();
    })
});

ipc.server.start();
github Mostafa-Samir / klyng / tests / specs / beacon / beacon-remote.specs.js View on Github external
var klyngMsgPromise = new Promise(function(resolve, reject) {
            ipc.serveNet('127.0.0.1', 9876, function() {
                ipc.server.on('KLYNG:MSG', function(msg, socket) {
                    try {
                        expect(msg.header.from).to.equal(1);
                        expect(msg.header.to).to.equal(0);
                        expect(msg.data).to.equal("Weee!");
                        resolve();
                    }
                    catch(err) { reject(err); }
                });
            });
            ipc.server.start();
        });
github kuzzleio / kuzzle / lib / services / ipc.js View on Github external
startServer: function () {
    ipc.config.id = this.serverName;

    ipc.serveNet(this.host, this.port, function () {
      ipc.server.on('dispatch', function (data) {
        ipc.server.broadcast(data.room, data.message);
      });
    }.bind(this));

    ipc.server.start();
  },

node-ipc

A nodejs module for local and remote Inter Process Communication (IPC), Neural Networking, and able to facilitate machine learning.

MIT
Latest version published 3 months ago

Package Health Score

71 / 100
Full package analysis