@remote.it/core
Version:
Core remote.it JavasScript/TypeScript library
45 lines • 2.05 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var debug_1 = __importDefault(require("debug"));
var Process_1 = require("./Process");
var Environment_1 = require("./Environment");
var d = debug_1.default('remoteit:InitiatorProcess');
var InitiatorProcess = /** @class */ (function (_super) {
__extends(InitiatorProcess, _super);
function InitiatorProcess(config, //& { debug?: boolean },
user //{ username: string; authHash: string }
) {
var _this = this;
var encryption = 2;
var restrictedIPs = '0.0.0.0';
var usernameBase64 = Buffer.from(user.username).toString('base64');
var hostname = config.hostname || '127.0.0.1';
var binary = Environment_1.Environment.connectdPath;
_this = _super.call(this, binary + " -p " + usernameBase64 + " " + user.authHash + " " + config.uid + " T" + config.port + " " + encryption + " " + hostname + " " + restrictedIPs + " 12 0 0") || this;
_this.authHash = user.authHash;
_this.port = config.port;
_this.hostname = hostname;
_this.uid = config.uid;
_this.username = user.username;
return _this;
}
return InitiatorProcess;
}(Process_1.Process));
exports.InitiatorProcess = InitiatorProcess;
//# sourceMappingURL=InitiatorProcess.js.map