nodejs-traceroute
nodejs-traceroute copied to clipboard
on.destination is not triggered
I have this:
const Traceroute = require('nodejs-traceroute');
try {
const tracer = new Traceroute();
tracer
.on('pid', (pid) => {
console.log(`pid: ${pid}`);
})
.on('destination', (destination) => {
console.log(`destination: ${destination}`);
})
.on('hop', (hop) => {
console.log(`hop: ${JSON.stringify(hop)}`);
})
.on('close', (code) => {
console.log(`close: code ${code}`);
});
tracer.trace('www.google.com');
} catch (ex) {
console.log(ex);
}
My output:
pid: 29895
hop: {"hop":1,"ip":"192.168.1.254","rtt1":"4.481 ms"}
hop: {"hop":2,"ip":"*","rtt1":"*"}
hop: {"hop":3,"ip":"*","rtt1":"*"}
hop: {"hop":4,"ip":"31.55.185.184","rtt1":"29.203 ms"}
hop: {"hop":5,"ip":"195.99.127.146","rtt1":"32.910 ms"}
hop: {"hop":6,"ip":"109.159.252.158","rtt1":"63.543 ms"}
hop: {"hop":7,"ip":"109.159.253.69","rtt1":"31.889 ms"}
hop: {"hop":8,"ip":"*","rtt1":"*"}
hop: {"hop":9,"ip":"172.253.71.200","rtt1":"28.291 ms"}
hop: {"hop":10,"ip":"108.170.246.144","rtt1":"26.056 ms"}
hop: {"hop":11,"ip":"172.217.169.36","rtt1":"30.695 ms"}
close: code 0
there is no destination logged to the console. What is wrong?
have the same issue
I have the same issue on MacOS, but if you use windowsOS, you can see destination