2022-04-30 19:58:17 +00:00
|
|
|
'use strict';
|
|
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
2024-05-23 22:49:18 +00:00
|
|
|
exports.Processing = void 0;
|
2022-04-30 19:58:17 +00:00
|
|
|
const exec_1 = require("exec");
|
|
|
|
class Processing {
|
|
|
|
constructor(url) {
|
|
|
|
this._baseUrl = (url.indexOf('http') === -1 && url.indexOf('://') === -1) ? `http://${url}` : url;
|
|
|
|
}
|
|
|
|
async move() {
|
|
|
|
return new Promise(async (resolve, reject) => {
|
|
|
|
const timeStart = +new Date();
|
|
|
|
const url = `${this._baseUrl}`;
|
|
|
|
const cmd = `curl --http0.9 ${url}`;
|
|
|
|
let res;
|
|
|
|
let ms;
|
|
|
|
//console.log(url)
|
|
|
|
try {
|
2024-04-06 23:09:50 +00:00
|
|
|
res = await (0, exec_1.exec)(cmd);
|
2022-04-30 19:58:17 +00:00
|
|
|
}
|
|
|
|
catch (err) {
|
|
|
|
return reject(err);
|
|
|
|
}
|
|
|
|
ms = (+new Date()) - timeStart;
|
|
|
|
return resolve(ms);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
async setDir(dir) {
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
return resolve(0);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
2024-05-23 22:49:18 +00:00
|
|
|
exports.Processing = Processing;
|
|
|
|
module.exports = { Processing };
|
2022-04-30 19:58:17 +00:00
|
|
|
//# sourceMappingURL=index.js.map
|