Monday, 29 May 2017

How can do to get zeromq.js properly installed with libsodium using npm?

I am struggling trying to use curve encryption with ZeroMQ node.js binding, because I am not able to get the npm package built and linked to libsodium library.

Installation:
npm install zeromq

Test code:

var zmq = require('zeromq');

try {
  zmq.zmqCurveKeypair()
} catch(e) {
  console.log(e);
  return;
}

Ouput trace:

> streaming-encrypted.js
> Error: zmq_curve_keypair operation failed. Method support in libzmq v4+ -with-libsodium.

The trace is kind of explicit, ZMQ needs to be compiled with libsSodium or TweetNacl to have CURVE mechanism enabled.

My problem is my lack of understanding of how npm install packages:

  • I understand npm download (this this case at least) prebuild binaries from ZMQ's github
  • I think it is possible to rebuild the project as the package.json contains a command to build zmq in case the prebuild installation failed.
  • I have looked into these other scripts and I find nothing about libsodium tweetNACL or anything for CURVE.
  • The README.md doesn't says anything about how to do it, so the solution must be obvious to npm experts...

So, to me it looks like there is no prebuilt version of zeromq.js with libsodium. Considering all of this, my question is:

How can do to get zeromq.js properly installed with libsodium using npm?



via vtellier

No comments:

Post a Comment