danielzzz / node-ping

a poor man's ping library (using udp scanning) for node
MIT License
336 stars 105 forks source link

Is broadcast ping supported? #83

Closed komalpharate closed 6 years ago

mondwan commented 6 years ago

Not quite. Depends on your system, you can send your platform specific flags for using broadcast ping via an extra key

在 2018年5月8日週二 20:23,Komal Pharate notifications@github.com 寫道:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/danielzzz/node-ping/issues/83, or mute the thread https://github.com/notifications/unsubscribe-auth/ADuAo2fG7cJfmW2Nc6gicLg9Q4BRYKMRks5twY4jgaJpZM4T2i30 .

komalpharate commented 6 years ago

`var ping = require('ping');

var hosts = ['10.9.44.255']; hosts.forEach(function(host){ ping.promise.probe(host, { timeout: 10, extra: ['-b'], }).then(function (res) { console.log("Result-",res.alive); }); });` This should work?

mondwan commented 6 years ago

It should work for Linux system as -b should be a flag on linux's ping for supporting boardcast flag

在 2018年5月11日週五 15:05,Komal Pharate notifications@github.com 寫道:

`var ping = require('ping');

var hosts = ['10.9.44.255']; hosts.forEach(function(host){ ping.promise.probe(host, { timeout: 10, extra: ['-b'], }).then(function (res) { console.log("Result-",res.alive); }); });` This should work?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/danielzzz/node-ping/issues/83#issuecomment-388279746, or mute the thread https://github.com/notifications/unsubscribe-auth/ADuAoz0Qn3kTzrszTzPQhPaCSWivnJd0ks5txTgsgaJpZM4T2i30 .