nodejs-traceroute icon indicating copy to clipboard operation
nodejs-traceroute copied to clipboard

on.destination is not triggered

Open cjrobbertse opened this issue 4 years ago • 2 comments

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?

cjrobbertse avatar Jul 23 '20 10:07 cjrobbertse

have the same issue

chenxiaoyao6228 avatar Sep 27 '20 10:09 chenxiaoyao6228

I have the same issue on MacOS, but if you use windowsOS, you can see destination

alls7554 avatar Jun 16 '21 08:06 alls7554