I try to set up the package for a simple connection without login. I've try some example but it seem that the connection doesn't work. The code have to work on Windows and the connection is working using the telnet client feature.
Here is the code
import { Telnet } from "telnet-client";
const connection = new Telnet();
// these parameters are just examples and most probably won't work for your use-case.
const params = {
host: "192.168.10.112",
port: 4567,
negotiationMandatory: false,
};
connection.on("ready", (prompt) => {
console.log("prompt", prompt);
connection.exec(cmd, (err, response) => {
console.log("rep", response);
});
});
connection.on("timeout", () => {
console.log("socket timeout!");
connection.end();
});
connection.on("close", () => {
console.log("connection closed");
});
connection.connect(params);
Hello,
I try to set up the package for a simple connection without login. I've try some example but it seem that the connection doesn't work. The code have to work on Windows and the connection is working using the telnet client feature.
Here is the code
And here is the result
Thanks