You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
well im trying for weeks to enable a simple curve on pub and sub! i found example for v6 in type script but when i try to subscribe specific topic doesn't work!
could someone please give me an example in the code below using curve
`const zmq = require("zeromq")
async function run() {
const sock = new zmq.Subscriber
sock.connect("tcp://127.0.0.1:3000")
sock.subscribe("kitty cats")
console.log("Subscriber connected to port 3000")
for await (const [topic, msg] of sock) {
console.log("received a message related to:", topic, "containing message:", msg)
}
}
run()`
`const zmq = require("zeromq")
async function run() {
const sock = new zmq.Publisher
await sock.bind("tcp://127.0.0.1:3000")
console.log("Publisher bound to port 3000")
while (true) {
console.log("sending a multipart message envelope")
await sock.send(["kitty cats", "meow!"])
await new Promise(resolve => setTimeout(resolve, 500))
}
}
run()`
The text was updated successfully, but these errors were encountered:
for (const s of [sock]) {
s.curveServerKey = serverPublickey;
s.curvePublicKey = Keypair.publicKey;
s.curveSecretKey = Keypair.secretKey;
}
async function run() {
sock.connect("tcp://127.0.0.1:3000")
sock.subscribe("kitty cats")
console.log("Subscriber connected to port 3000")
for await (const [topic, msg] of sock) {
console.log("received a message related to:", topic, "containing message:", msg)
}
}
run()
// pub
const zmq = require("zeromq")
const sock = new zmq.Publisher
well im trying for weeks to enable a simple curve on pub and sub! i found example for v6 in type script but when i try to subscribe specific topic doesn't work!
could someone please give me an example in the code below using curve
`const zmq = require("zeromq")
async function run() {
const sock = new zmq.Subscriber
sock.connect("tcp://127.0.0.1:3000")
sock.subscribe("kitty cats")
console.log("Subscriber connected to port 3000")
for await (const [topic, msg] of sock) {
console.log("received a message related to:", topic, "containing message:", msg)
}
}
run()`
`const zmq = require("zeromq")
async function run() {
const sock = new zmq.Publisher
await sock.bind("tcp://127.0.0.1:3000")
console.log("Publisher bound to port 3000")
while (true) {
console.log("sending a multipart message envelope")
await sock.send(["kitty cats", "meow!"])
await new Promise(resolve => setTimeout(resolve, 500))
}
}
run()`
The text was updated successfully, but these errors were encountered: