browsermation 0.0.67 → 0.0.68
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/dist/bin/cli.js +25 -19
- package/package.json +1 -1
package/dist/bin/cli.js
CHANGED
|
@@ -13417,7 +13417,7 @@ var require_form_data = __commonJS({
|
|
|
13417
13417
|
var parseUrl = require("url").parse;
|
|
13418
13418
|
var fs = require("fs");
|
|
13419
13419
|
var Stream2 = require("stream").Stream;
|
|
13420
|
-
var
|
|
13420
|
+
var crypto2 = require("crypto");
|
|
13421
13421
|
var mime = require_mime_types();
|
|
13422
13422
|
var asynckit = require_asynckit();
|
|
13423
13423
|
var setToStringTag = require_es_set_tostringtag();
|
|
@@ -13623,7 +13623,7 @@ var require_form_data = __commonJS({
|
|
|
13623
13623
|
return Buffer.concat([dataBuffer, Buffer.from(this._lastBoundary())]);
|
|
13624
13624
|
};
|
|
13625
13625
|
FormData3.prototype._generateBoundary = function() {
|
|
13626
|
-
this._boundary = "--------------------------" +
|
|
13626
|
+
this._boundary = "--------------------------" + crypto2.randomBytes(12).toString("hex");
|
|
13627
13627
|
};
|
|
13628
13628
|
FormData3.prototype.getLengthSync = function() {
|
|
13629
13629
|
var knownLength = this._overheadLength + this._valueLength;
|
|
@@ -42258,7 +42258,7 @@ var {
|
|
|
42258
42258
|
// package.json
|
|
42259
42259
|
var package_default = {
|
|
42260
42260
|
name: "browsermation",
|
|
42261
|
-
version: "0.0.
|
|
42261
|
+
version: "0.0.68",
|
|
42262
42262
|
description: "The testing platform for Playwright by Browsermation.",
|
|
42263
42263
|
main: "./dist/index.js",
|
|
42264
42264
|
types: "./dist/index.d.ts",
|
|
@@ -46649,11 +46649,7 @@ function startTunnel(tunnelProcess, options) {
|
|
|
46649
46649
|
);
|
|
46650
46650
|
process.exit(1);
|
|
46651
46651
|
}
|
|
46652
|
-
|
|
46653
|
-
if (options?.region === "eu") {
|
|
46654
|
-
defaultDomain = "browsermationtunnel.eu";
|
|
46655
|
-
}
|
|
46656
|
-
const tunnelDomain = `${options.subdomain || crypto.randomUUID()}.${defaultDomain}`;
|
|
46652
|
+
const defaultDomain = "browsermationtunnel.com";
|
|
46657
46653
|
tunnelProcess = (0, import_node_child_process.spawn)("ssh", [
|
|
46658
46654
|
"-o",
|
|
46659
46655
|
"StrictHostKeyChecking=no",
|
|
@@ -46665,10 +46661,6 @@ function startTunnel(tunnelProcess, options) {
|
|
|
46665
46661
|
"-p",
|
|
46666
46662
|
"2200",
|
|
46667
46663
|
"http",
|
|
46668
|
-
"--proxy_name",
|
|
46669
|
-
tunnelDomain,
|
|
46670
|
-
"--custom_domain",
|
|
46671
|
-
tunnelDomain,
|
|
46672
46664
|
"--user",
|
|
46673
46665
|
process.env.BM_API_KEY || ""
|
|
46674
46666
|
]);
|
|
@@ -46684,17 +46676,31 @@ function startTunnel(tunnelProcess, options) {
|
|
|
46684
46676
|
if (process.env.BM_DEBUG) {
|
|
46685
46677
|
console.log(`stdout: ${data}`);
|
|
46686
46678
|
}
|
|
46679
|
+
if (data.toString().includes("RemoteAddress:")) {
|
|
46680
|
+
const domain = data.toString().split("\n").map((line) => line.trim()).find((line) => line.startsWith("RemoteAddress:")).replace("RemoteAddress: ", "");
|
|
46681
|
+
if (domain) {
|
|
46682
|
+
console.log(
|
|
46683
|
+
source_default.green.bold(
|
|
46684
|
+
`\u2705 Tunnel is running! Access your application at: https://${domain}`
|
|
46685
|
+
)
|
|
46686
|
+
);
|
|
46687
|
+
}
|
|
46688
|
+
}
|
|
46687
46689
|
});
|
|
46688
46690
|
tunnelProcess?.stderr?.on("data", (data) => {
|
|
46691
|
+
if (data.toString().includes("Permanently added")) {
|
|
46692
|
+
return;
|
|
46693
|
+
}
|
|
46694
|
+
if (data.toString().includes("closed by remote host.")) {
|
|
46695
|
+
console.error(
|
|
46696
|
+
source_default.red.bold(
|
|
46697
|
+
"\u274C Error: Please check that your BM_API_KEY is correct and has permissions to create tunnels."
|
|
46698
|
+
)
|
|
46699
|
+
);
|
|
46700
|
+
process.exit(1);
|
|
46701
|
+
}
|
|
46689
46702
|
console.error(`stderr: ${data}`);
|
|
46690
46703
|
});
|
|
46691
|
-
const tunnelUrl = `https://${tunnelDomain}`;
|
|
46692
|
-
console.log(
|
|
46693
|
-
source_default.green.bold(
|
|
46694
|
-
`\u2705 Tunnel setup complete. You can now access your project at: ${tunnelUrl}`
|
|
46695
|
-
)
|
|
46696
|
-
);
|
|
46697
|
-
return { tunnelProcess, tunnelUrl };
|
|
46698
46704
|
}
|
|
46699
46705
|
|
|
46700
46706
|
// src/bin/cli.ts
|