I am trying to connect my web app (Node js) to a zmq backend which is written in python and using zmq curve encryption. But I am unable to find any helpful example or another resource about curve encryption in Node js. I tried this code :
const zmq = require("zeromq");
async function run(){
const sock = new zmq.Request;
sock.curve_publickey = 'wka2b<1234]+x64D%/a?+l0QS*3XRfhn$i!}3lM}' // Not the original keys. ;-)
sock.curve_secretkey = '?frhwU4mFY1g168tXp64(N6sr/nn{=pQdYP**Ej*'
sock.curve_serverkey = '4:U}SW6z?:!]uE44]46.TRGV^4z55+(TTX$}C(DC'
sock.connect("tcp://localhost:9090")
console.log("Connected to Server")
await sock.send(`Request=GenerateModels|UserId=${user}|FileName=${req.params.name}`)
const [result] = await sock.receive()
console.log(result.toString('utf8'))
}
run()
But it doesn't connect to the server. I think I am missing the correct syntax for this. Any help or link to the documentation (searched but no luck) to curve security in zmq (Node js) would be really helpful.