Initial commit
This commit is contained in:
35
node_modules/ping/examples/example_win_de_v6.js
generated
vendored
Normal file
35
node_modules/ping/examples/example_win_de_v6.js
generated
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
// -------- example -----------------------
|
||||
|
||||
'use strict';
|
||||
|
||||
var ping = require('../index');
|
||||
|
||||
var hosts = ['google.de']; // , '192.168.1.1', 'google.com', 'yahoo.com'];
|
||||
|
||||
// Running with custom config
|
||||
hosts.forEach(function (host) {
|
||||
ping.promise.probe(host, {
|
||||
// v6: true,
|
||||
min_reply: 2,
|
||||
sourceAddr: 'your NIC\'s IPv6 address',
|
||||
// sourceAddr: false,
|
||||
})
|
||||
.then(function (res) {
|
||||
console.log('\n');
|
||||
console.log(res);
|
||||
})
|
||||
.done();
|
||||
|
||||
// Running ping with some default argument gone
|
||||
ping.sys.probe(host, function (isAlive) {
|
||||
var msg = isAlive ?
|
||||
'host ' + host + ' is alive' : 'host ' + host + ' is dead';
|
||||
console.log('\n');
|
||||
console.log(msg);
|
||||
}, {
|
||||
timeout: false,
|
||||
// v6: true,
|
||||
min_reply: 2,
|
||||
sourceAddr: 'your NIC\'s IPv6 address',
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user