devtunnel-cli 3.0.45 ā 3.1.0
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/README.md +18 -7
- package/package.json +89 -86
- package/src/core/RUN.js +64 -64
- package/src/core/index.js +374 -374
- package/src/core/proxy-server.js +105 -105
- package/src/core/setup-cloudflared.js +427 -427
- package/src/core/start.js +2 -2
- package/src/core/static-server.js +109 -109
- package/src/utils/folder-picker.js +140 -140
- package/src/utils/pages/index.html +1 -1
- package/src/utils/tunnel-helpers.js +35 -35
package/README.md
CHANGED
|
@@ -8,7 +8,17 @@
|
|
|
8
8
|
|
|
9
9
|
š **Website:** [devtunnel-cli.vercel.app](https://devtunnel-cli.vercel.app) | š¦ **npm:** [devtunnel-cli](https://www.npmjs.com/package/devtunnel-cli) | š» **GitHub:** [maiz-an/DevTunnel-CLI](https://github.com/maiz-an/DevTunnel-CLI)
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
| Platform | Command |
|
|
14
|
+
| -------- | ------- |
|
|
15
|
+
| **Windows** | `winget install devtunnel-cli` |
|
|
16
|
+
| **macOS** | `brew install devtunnel-cli` |
|
|
17
|
+
| **Linux** | `sudo apt install devtunnel-cli` |
|
|
18
|
+
| **npm** | `npm i -g devtunnel-cli` |
|
|
19
|
+
|
|
20
|
+
Windows, macOS, and Linux: same style ā **standalone binary**, no Node required.
|
|
21
|
+
**Linux (first time only):** run once `curl -fsSL https://raw.githubusercontent.com/maiz-an/DevTunnel-CLI/main/scripts/install.sh | sudo sh` to add our APT repo, then use the command above. npm requires Node.
|
|
12
22
|
|
|
13
23
|
---
|
|
14
24
|
|
|
@@ -24,7 +34,8 @@ DevTunnel-CLI is built for developers who need instant public URLs to share work
|
|
|
24
34
|
|
|
25
35
|
### Step-by-Step Guide
|
|
26
36
|
|
|
27
|
-
**1. Install DevTunnel (one-time setup):**
|
|
37
|
+
**1. Install DevTunnel (one-time setup):**
|
|
38
|
+
Use **Windows** (winget), **macOS** (brew), **Linux** (apt), or **npm** ā see the [Install](#install) table above.
|
|
28
39
|
|
|
29
40
|
```bash
|
|
30
41
|
npm i -g devtunnel-cli
|
|
@@ -75,7 +86,7 @@ devtunnel-cli # Auto-detects project type and port!
|
|
|
75
86
|
|
|
76
87
|
**Important:** Run `devtunnel-cli` from the same directory as your project!
|
|
77
88
|
|
|
78
|
-
1. **Install DevTunnel** (one-time):
|
|
89
|
+
1. **Install DevTunnel** (one-time): use winget, brew, apt, or [npm](#install) above.
|
|
79
90
|
2. **Go to your project**: `cd your-project` (Node, Laravel, HTML, or XAMPP folder)
|
|
80
91
|
3. **Have your app running**: `npm run dev`, `php artisan serve`, or XAMPP. For HTML, optional ā DevTunnel can serve it.
|
|
81
92
|
4. **Open a new terminal** in the same project directory
|
|
@@ -109,11 +120,11 @@ devtunnel-cli
|
|
|
109
120
|
|
|
110
121
|
## š ļø Requirements
|
|
111
122
|
|
|
112
|
-
-
|
|
113
|
-
-
|
|
114
|
-
-
|
|
123
|
+
- **Windows / macOS / Linux (OS install):** No Node required ā standalone binary.
|
|
124
|
+
- **npm install:** Node.js 16+ ([nodejs.org](https://nodejs.org)).
|
|
125
|
+
- Internet connection and your dev server running.
|
|
115
126
|
|
|
116
|
-
|
|
127
|
+
Cloudflare is automatically bundled on first run.
|
|
117
128
|
|
|
118
129
|
---
|
|
119
130
|
|
package/package.json
CHANGED
|
@@ -1,87 +1,90 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "devtunnel-cli",
|
|
3
|
-
"version": "3.0
|
|
4
|
-
"type": "module",
|
|
5
|
-
"description": "DevTunnel-CLI ā fast, zero-config tool to share local servers for development, testing, demos, and webhook debugging. npm i -g devtunnel-cli.",
|
|
6
|
-
"main": "src/core/start.js",
|
|
7
|
-
"files": [
|
|
8
|
-
"README.md",
|
|
9
|
-
"src"
|
|
10
|
-
],
|
|
11
|
-
"bin": {
|
|
12
|
-
"devtunnel-cli": "src/core/RUN.js"
|
|
13
|
-
},
|
|
14
|
-
"scripts": {
|
|
15
|
-
"start": "node src/core/RUN.js",
|
|
16
|
-
"dev": "node src/core/RUN.js",
|
|
17
|
-
"run": "node src/core/RUN.js",
|
|
18
|
-
"tunnel": "node src/core/index.js",
|
|
19
|
-
"sync-version": "node sync-version.js",
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"DevTunnel",
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"ngrok",
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
|
|
72
|
-
"
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
"
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
|
|
86
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "devtunnel-cli",
|
|
3
|
+
"version": "3.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "DevTunnel-CLI ā fast, zero-config tool to share local servers for development, testing, demos, and webhook debugging. npm i -g devtunnel-cli.",
|
|
6
|
+
"main": "src/core/start.js",
|
|
7
|
+
"files": [
|
|
8
|
+
"README.md",
|
|
9
|
+
"src"
|
|
10
|
+
],
|
|
11
|
+
"bin": {
|
|
12
|
+
"devtunnel-cli": "src/core/RUN.js"
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"start": "node src/core/RUN.js",
|
|
16
|
+
"dev": "node src/core/RUN.js",
|
|
17
|
+
"run": "node src/core/RUN.js",
|
|
18
|
+
"tunnel": "node src/core/index.js",
|
|
19
|
+
"sync-version": "node sync-version.js",
|
|
20
|
+
"build:standalone": "node scripts/build-standalone.js",
|
|
21
|
+
"test": "node -e \"console.log('ok')\"",
|
|
22
|
+
"prepublishOnly": "npm test",
|
|
23
|
+
"postinstall": "node src/utils/postinstall-global-check.cjs"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"DevTunnel-CLI",
|
|
27
|
+
"DevTunnel",
|
|
28
|
+
"devtunnel",
|
|
29
|
+
"dev-tunnel",
|
|
30
|
+
"Dev-Tunnel",
|
|
31
|
+
"devtunnel-cli",
|
|
32
|
+
"dev-tunnel-cli",
|
|
33
|
+
"Dev-Tunnel-CLI",
|
|
34
|
+
"multiple ports",
|
|
35
|
+
"dev tunnel",
|
|
36
|
+
"localhost tunnel",
|
|
37
|
+
"cloudflare tunnel",
|
|
38
|
+
"ngrok alternative",
|
|
39
|
+
"ngrok",
|
|
40
|
+
"localtunnel",
|
|
41
|
+
"dev-server",
|
|
42
|
+
"share localhost",
|
|
43
|
+
"public-url",
|
|
44
|
+
"port forwarding",
|
|
45
|
+
"local development",
|
|
46
|
+
"vite tunnel",
|
|
47
|
+
"react dev server",
|
|
48
|
+
"nextjs tunnel",
|
|
49
|
+
"nestjs",
|
|
50
|
+
"express",
|
|
51
|
+
"laravel",
|
|
52
|
+
"php",
|
|
53
|
+
"html",
|
|
54
|
+
"backend",
|
|
55
|
+
"frontend",
|
|
56
|
+
"proxy",
|
|
57
|
+
"development tools",
|
|
58
|
+
"web development",
|
|
59
|
+
"tunnel service",
|
|
60
|
+
"local server sharing",
|
|
61
|
+
"dev server proxy",
|
|
62
|
+
"cloudflare tunnel cli",
|
|
63
|
+
"ngrok alternative free",
|
|
64
|
+
"zero config tunnel",
|
|
65
|
+
"development",
|
|
66
|
+
"localhost"
|
|
67
|
+
],
|
|
68
|
+
"author": "maiz",
|
|
69
|
+
"license": "MIT",
|
|
70
|
+
"preferGlobal": true,
|
|
71
|
+
"repository": {
|
|
72
|
+
"type": "git",
|
|
73
|
+
"url": "git+https://github.com/maiz-an/DevTunnel-CLI.git"
|
|
74
|
+
},
|
|
75
|
+
"bugs": {
|
|
76
|
+
"url": "https://github.com/maiz-an/DevTunnel-CLI/issues"
|
|
77
|
+
},
|
|
78
|
+
"homepage": "https://devtunnel-cli.vercel.app",
|
|
79
|
+
"engines": {
|
|
80
|
+
"node": ">=16.0.0"
|
|
81
|
+
},
|
|
82
|
+
"dependencies": {
|
|
83
|
+
"http-proxy": "^1.18.1",
|
|
84
|
+
"localtunnel": "^2.0.2",
|
|
85
|
+
"prompts": "^2.4.2"
|
|
86
|
+
},
|
|
87
|
+
"devDependencies": {
|
|
88
|
+
"@yao-pkg/pkg": "^5.15.0"
|
|
89
|
+
}
|
|
87
90
|
}
|
package/src/core/RUN.js
CHANGED
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
// Universal Node.js Launcher - Works on ALL platforms!
|
|
4
|
-
import { spawn } from "child_process";
|
|
5
|
-
import { readFileSync, existsSync } from "fs";
|
|
6
|
-
import { fileURLToPath } from "url";
|
|
7
|
-
import { dirname, join } from "path";
|
|
8
|
-
|
|
9
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
10
|
-
const __dirname = dirname(__filename);
|
|
11
|
-
|
|
12
|
-
// Version flags: devtunnel-cli --version, -v, or --v
|
|
13
|
-
const args = process.argv.slice(2);
|
|
14
|
-
const showVersion = args.some((a) => a === "--version" || a === "-v" || a === "--v");
|
|
15
|
-
if (showVersion) {
|
|
16
|
-
try {
|
|
17
|
-
const pkgPath = join(dirname(dirname(__dirname)), "package.json");
|
|
18
|
-
const version = existsSync(pkgPath)
|
|
19
|
-
? JSON.parse(readFileSync(pkgPath, "utf8")).version
|
|
20
|
-
: "?.?.?";
|
|
21
|
-
console.log(version);
|
|
22
|
-
} catch (err) {
|
|
23
|
-
console.log("?.?.?");
|
|
24
|
-
}
|
|
25
|
-
process.exit(0);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const originalEmitWarning = process.emitWarning;
|
|
29
|
-
process.emitWarning = function(warning, ...args) {
|
|
30
|
-
if (typeof warning === 'string' && warning.includes('util._extend')) {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
return originalEmitWarning.call(this, warning, ...args);
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
process.stdout.write('\x1B[2J\x1B[0f');
|
|
37
|
-
console.clear();
|
|
38
|
-
|
|
39
|
-
const startPath = join(__dirname, "start.js");
|
|
40
|
-
const child = spawn("node", [startPath], {
|
|
41
|
-
stdio: "inherit",
|
|
42
|
-
shell: false
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
child.on("error", (error) => {
|
|
46
|
-
console.error("ā Error starting app:", error.message);
|
|
47
|
-
process.exit(1);
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
child.on("close", (code) => {
|
|
51
|
-
if (code !== 0) {
|
|
52
|
-
console.log(`\nā ļø Process exited with code ${code}`);
|
|
53
|
-
}
|
|
54
|
-
process.exit(code || 0);
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
// Handle Ctrl+C
|
|
58
|
-
process.on("SIGINT", () => {
|
|
59
|
-
child.kill("SIGINT");
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
process.on("SIGTERM", () => {
|
|
63
|
-
child.kill("SIGTERM");
|
|
64
|
-
});
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// Universal Node.js Launcher - Works on ALL platforms!
|
|
4
|
+
import { spawn } from "child_process";
|
|
5
|
+
import { readFileSync, existsSync } from "fs";
|
|
6
|
+
import { fileURLToPath } from "url";
|
|
7
|
+
import { dirname, join } from "path";
|
|
8
|
+
|
|
9
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
10
|
+
const __dirname = dirname(__filename);
|
|
11
|
+
|
|
12
|
+
// Version flags: devtunnel-cli --version, -v, or --v
|
|
13
|
+
const args = process.argv.slice(2);
|
|
14
|
+
const showVersion = args.some((a) => a === "--version" || a === "-v" || a === "--v");
|
|
15
|
+
if (showVersion) {
|
|
16
|
+
try {
|
|
17
|
+
const pkgPath = join(dirname(dirname(__dirname)), "package.json");
|
|
18
|
+
const version = existsSync(pkgPath)
|
|
19
|
+
? JSON.parse(readFileSync(pkgPath, "utf8")).version
|
|
20
|
+
: "?.?.?";
|
|
21
|
+
console.log(version);
|
|
22
|
+
} catch (err) {
|
|
23
|
+
console.log("?.?.?");
|
|
24
|
+
}
|
|
25
|
+
process.exit(0);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const originalEmitWarning = process.emitWarning;
|
|
29
|
+
process.emitWarning = function(warning, ...args) {
|
|
30
|
+
if (typeof warning === 'string' && warning.includes('util._extend')) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
return originalEmitWarning.call(this, warning, ...args);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
process.stdout.write('\x1B[2J\x1B[0f');
|
|
37
|
+
console.clear();
|
|
38
|
+
|
|
39
|
+
const startPath = join(__dirname, "start.js");
|
|
40
|
+
const child = spawn("node", [startPath], {
|
|
41
|
+
stdio: "inherit",
|
|
42
|
+
shell: false
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
child.on("error", (error) => {
|
|
46
|
+
console.error("ā Error starting app:", error.message);
|
|
47
|
+
process.exit(1);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
child.on("close", (code) => {
|
|
51
|
+
if (code !== 0) {
|
|
52
|
+
console.log(`\nā ļø Process exited with code ${code}`);
|
|
53
|
+
}
|
|
54
|
+
process.exit(code || 0);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
// Handle Ctrl+C
|
|
58
|
+
process.on("SIGINT", () => {
|
|
59
|
+
child.kill("SIGINT");
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
process.on("SIGTERM", () => {
|
|
63
|
+
child.kill("SIGTERM");
|
|
64
|
+
});
|