I'm learning websocket nodejs, I want to connect to routeros via websocket like the https://github.com/aluisiora/node-routeros/ package, the package is too broad, I just want to know how to connect.
I've read the official documentation https://wiki.mikrotik.com/wiki/Manual:API, but I'm having trouble understanding it.
I have tried it this way, but did not get any response:
client.connect(port, host, function () {
console.log("Connected");
client.write(encodeString("/login"));
client.write(encodeString(`=name=${user}`));
client.write(encodeString(`=password=${password}`));
});
client.on("data", function (data) {
console.log("Received: " + data); // not excetue
});
I'm looking for code samples to connect to routeros via nodejs socket, hopefully someone shares here.
Thanks in advance, I really appreciate any answer.