UNPKG

allproxy

Version:

AllProxy: MITM HTTP Debugging Tool.

21 lines 646 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const child_process_1 = require("child_process"); class Ping { static host(hostName) { return new Promise((resolve) => { const proc = (0, child_process_1.spawn)('ping', ['-c', '1', hostName]); proc.stdout.on('data', _data => { resolve(true); }); proc.stderr.on('data', _data => { resolve(false); }); proc.on('error', _error => { resolve(false); }); }); } } exports.default = Ping; //# sourceMappingURL=Ping.js.map