zmq-transport
v0.0.5
Published
ZeroMQ transport for jrpc2
Downloads
5
Readme
zmqTransport
ZeroMQ transport for JRPC2
INSTALL
npm install zmq-transport
USING
Server
var rpc = require('jrpc2');
var zmqTransport = require('zmq-transport');
var server = new rpc.server;
server.loadModules(__dirname + '/modules/', function () {
var zmq = new zmqTransport({url: 'tcp://127.0.0.1:5555'});
zmq.listen(server);
});
Client:
var rpc = require('jrpc2');
var zmqTransport = require('zmq-transport');
var zmq = new zmqTransport({url: 'tcp://127.0.0.1:5555'});
var client = new rpc.client(zmq);
client.call('users.auth', ["admin","swd"], function (err, raw) {
console.log(err, raw);
});