Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
ZeroMQ rep socket example for node.js
var zmq = require('zmq');
var responder = zmq.socket('rep');
responder.on('message', function(payload)
var data = JSON.parse(payload);
var response = {};
var keys = Object.keys(data);
for (var i = 0; i < keys.length; i++)
response[data[keys[i]]] = keys[i];
var endpoint = 'tcp://';
console.log('listening on ' + endpoint);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.