bdy 1.12.9-dev → 1.12.10-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/distTs/package.json +1 -1
- package/distTs/src/tunnel/tunnel.js +14 -6
- package/package.json +1 -1
package/distTs/package.json
CHANGED
|
@@ -118,8 +118,10 @@ class Tunnel extends events_1.default {
|
|
|
118
118
|
sshServer;
|
|
119
119
|
ssh;
|
|
120
120
|
started;
|
|
121
|
+
httpAuthClient;
|
|
121
122
|
constructor({ agent, id, type, target, region, timeout, domain, name, subdomain, whitelist, tlsSettings, httpSettings, sshSettings, sshHostKey, }) {
|
|
122
123
|
super();
|
|
124
|
+
this.httpAuthClient = {};
|
|
123
125
|
if (!sshHostKey)
|
|
124
126
|
sshHostKey = (0, utils_1.createSshHostKey)();
|
|
125
127
|
this.agent = agent;
|
|
@@ -475,8 +477,10 @@ class Tunnel extends events_1.default {
|
|
|
475
477
|
password: user.pass,
|
|
476
478
|
})
|
|
477
479
|
});
|
|
478
|
-
if (statusCode !== 200)
|
|
480
|
+
if (statusCode !== 200) {
|
|
481
|
+
await body.dump();
|
|
479
482
|
return false;
|
|
483
|
+
}
|
|
480
484
|
const result = await body.json();
|
|
481
485
|
if (!result.success)
|
|
482
486
|
return false;
|
|
@@ -489,11 +493,15 @@ class Tunnel extends events_1.default {
|
|
|
489
493
|
}
|
|
490
494
|
}
|
|
491
495
|
_getHttpAuthClient() {
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
496
|
+
const host = cfg_1.default.getTokenHost();
|
|
497
|
+
if (!this.httpAuthClient[host]) {
|
|
498
|
+
this.httpAuthClient[host] = new undici_1.Pool(cfg_1.default.getTokenHost(), {
|
|
499
|
+
connect: {
|
|
500
|
+
rejectUnauthorized: false,
|
|
501
|
+
},
|
|
502
|
+
});
|
|
503
|
+
}
|
|
504
|
+
return this.httpAuthClient[host];
|
|
497
505
|
}
|
|
498
506
|
async _httpExchangeAuthCode(code) {
|
|
499
507
|
const client = this._getHttpAuthClient();
|