devtunnel-cli 3.0.44 โ†’ 3.0.45

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 CHANGED
@@ -1,141 +1,141 @@
1
- # DevTunnel-CLI ๐Ÿš€
2
-
3
- **Share your local dev servers worldwide - Zero config tunnel for any framework**
4
-
5
- [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
6
- [![Platform](https://img.shields.io/badge/Platform-Windows%20%7C%20macOS%20%7C%20Linux-lightgrey)](https://github.com/maiz-an/DevTunnel-CLI)
7
- [![npm version](https://img.shields.io/npm/v/devtunnel-cli)](https://www.npmjs.com/package/devtunnel-cli)
8
-
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
-
11
- **Install (global):** `npm i -g devtunnel-cli`
12
-
13
- ---
14
-
15
- ## ๐ŸŽฏ Purpose & Scope
16
-
17
- DevTunnel-CLI is designed for **DEVELOPMENT**, **TESTING**, **DEMOS**, and **WEBHOOK DEBUGGING**. It provides fast, frictionless access to your local dev servers from anywhere.
18
-
19
- DevTunnel-CLI is built for developers who need instant public URLs to share work-in-progress, test on mobile devices, demo features to clients, or debug webhooks from third-party services.
20
-
21
- ---
22
-
23
- ## โšก Quick Start
24
-
25
- ### Step-by-Step Guide
26
-
27
- **1. Install DevTunnel (one-time setup):**
28
-
29
- ```bash
30
- npm i -g devtunnel-cli
31
- ```
32
-
33
- **2. Navigate to your project directory:**
34
-
35
- ```bash
36
- cd your-project
37
- ```
38
-
39
- **3. Have your app running (in one terminal):**
40
-
41
- ```bash
42
- npm run dev
43
- # OR php artisan serve (Laravel)
44
- # OR XAMPP / Live Server (PHP/HTML)
45
- # HTML: optional โ€” DevTunnel can start a built-in server
46
- ```
47
-
48
- **4. Run DevTunnel (in another terminal, same directory):**
49
-
50
- ```bash
51
- cd your-project # Same directory as your project
52
- devtunnel-cli # Auto-detects project type and port!
53
- ```
54
-
55
- **That's it!** DevTunnel auto-detects Node, Laravel, HTML, and PHP/XAMPP projects.
56
-
57
- ---
58
-
59
- ## โœจ Features
60
-
61
- - ๐Ÿค– **Fully Automatic** - Cloudflare bundled, no installation needed
62
- - ๐ŸŽฏ **Zero Config** - No project changes needed
63
- - ๐Ÿ”— **Smart Proxy** - Bypasses Vite/React restrictions
64
- - ๐ŸŒ **Cross-Platform** - Windows, macOS, Linux
65
- - ๐Ÿš€ **Any Framework** - Node, React, Laravel, plain HTML, PHP/XAMPP
66
- - ๐Ÿ“„ **HTML** - Default port 5500; built-in static server if none running
67
- - ๐Ÿ˜ **PHP/XAMPP** - Port 80; supports htdocs subfolders (e.g. <http://localhost/YourProject/>)
68
- - ๐Ÿ”„ **Multi-Service** - Cloudflare, Ngrok, LocalTunnel fallback
69
- - ๐Ÿ”Œ **Multiple Ports** - DevTunnel-CLI supports multiple ports; auto-detects or lets you choose
70
- - ๐Ÿ“น **Streaming Support** - Handles video/audio files
71
-
72
- ---
73
-
74
- ## ๐Ÿ’ก How to Use
75
-
76
- **Important:** Run `devtunnel-cli` from the same directory as your project!
77
-
78
- 1. **Install DevTunnel** (one-time): `npm i -g devtunnel-cli`
79
- 2. **Go to your project**: `cd your-project` (Node, Laravel, HTML, or XAMPP folder)
80
- 3. **Have your app running**: `npm run dev`, `php artisan serve`, or XAMPP. For HTML, optional โ€” DevTunnel can serve it.
81
- 4. **Open a new terminal** in the same project directory
82
- 5. **Run DevTunnel**: `devtunnel-cli` (auto-detects project type and port!)
83
- 6. **Get your public URL** and share it! ๐ŸŒ
84
-
85
- **Example (Node):**
86
-
87
- ```bash
88
- # Terminal 1
89
- cd my-react-app
90
- npm run dev
91
-
92
- # Terminal 2 - same directory
93
- cd my-react-app
94
- devtunnel-cli
95
- ```
96
-
97
- **Works with:** Vite, React, Next.js, Express, NestJS, Laravel, plain HTML, PHP/XAMPP, and any HTTP/HTTPS server.
98
-
99
- ---
100
-
101
- ## ๐Ÿ“– Documentation
102
-
103
- - [Features](docs/FEATURES.md)
104
- - [Troubleshooting](docs/TROUBLESHOOTING.md)
105
- - [Contributing](docs/CONTRIBUTING.md)
106
- - [License](docs/LICENSE)
107
-
108
- ---
109
-
110
- ## ๐Ÿ› ๏ธ Requirements
111
-
112
- - Node.js 16+ (download from [nodejs.org](https://nodejs.org))
113
- - Internet connection
114
- - Your dev server running
115
-
116
- **No other installations needed!** Cloudflare is automatically bundled on first run.
117
-
118
- ---
119
-
120
- ## ๐Ÿ“„ License
121
-
122
- MIT License - see [LICENSE](docs/LICENSE)
123
-
124
- ---
125
-
126
- **Latest on [npm](https://www.npmjs.com/package/devtunnel-cli)** | Made with โค๏ธŽ for developers worldwide
127
-
128
- ---
129
-
130
- ## ๐Ÿ” Search keywords
131
-
132
- Find this project as: **DevTunnel**, **devtunnel**, **dev-tunnel**, **Dev-Tunnel**, **DevTunnel-CLI**, **devtunnel-cli**, **dev-tunnel-cli**, **Dev-Tunnel-CLI**. npm (install here): [devtunnel-cli](https://www.npmjs.com/package/devtunnel-cli) ยท Docs: [devtunnel-cli.vercel.app](https://devtunnel-cli.vercel.app) ยท GitHub: [maiz-an/DevTunnel-CLI](https://github.com/maiz-an/DevTunnel-CLI).
133
-
134
- ---
135
-
136
- ## ๐Ÿ“ฆ Links
137
-
138
- - **Website**: [devtunnel-cli.vercel.app](https://devtunnel-cli.vercel.app)
139
- - **npm**: [devtunnel-cli](https://www.npmjs.com/package/devtunnel-cli)
140
- - **GitHub**: [maiz-an/DevTunnel-CLI](https://github.com/maiz-an/DevTunnel-CLI)
141
- - **Issues**: [GitHub Issues](https://github.com/maiz-an/DevTunnel-CLI/issues)
1
+ # DevTunnel-CLI ๐Ÿš€
2
+
3
+ **Share your local dev servers worldwide - Zero config tunnel for any framework**
4
+
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
6
+ [![Platform](https://img.shields.io/badge/Platform-Windows%20%7C%20macOS%20%7C%20Linux-lightgrey)](https://github.com/maiz-an/DevTunnel-CLI)
7
+ [![npm version](https://img.shields.io/npm/v/devtunnel-cli)](https://www.npmjs.com/package/devtunnel-cli)
8
+
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
+
11
+ **Install (global):** `npm i -g devtunnel-cli`
12
+
13
+ ---
14
+
15
+ ## ๐ŸŽฏ Purpose & Scope
16
+
17
+ DevTunnel-CLI is designed for **DEVELOPMENT**, **TESTING**, **DEMOS**, and **WEBHOOK DEBUGGING**. It provides fast, frictionless access to your local dev servers from anywhere.
18
+
19
+ DevTunnel-CLI is built for developers who need instant public URLs to share work-in-progress, test on mobile devices, demo features to clients, or debug webhooks from third-party services.
20
+
21
+ ---
22
+
23
+ ## โšก Quick Start
24
+
25
+ ### Step-by-Step Guide
26
+
27
+ **1. Install DevTunnel (one-time setup):**
28
+
29
+ ```bash
30
+ npm i -g devtunnel-cli
31
+ ```
32
+
33
+ **2. Navigate to your project directory:**
34
+
35
+ ```bash
36
+ cd your-project
37
+ ```
38
+
39
+ **3. Have your app running (in one terminal):**
40
+
41
+ ```bash
42
+ npm run dev
43
+ # OR php artisan serve (Laravel)
44
+ # OR XAMPP / Live Server (PHP/HTML)
45
+ # HTML: optional โ€” DevTunnel can start a built-in server
46
+ ```
47
+
48
+ **4. Run DevTunnel (in another terminal, same directory):**
49
+
50
+ ```bash
51
+ cd your-project # Same directory as your project
52
+ devtunnel-cli # Auto-detects project type and port!
53
+ ```
54
+
55
+ **That's it!** DevTunnel auto-detects Node, Laravel, HTML, and PHP/XAMPP projects.
56
+
57
+ ---
58
+
59
+ ## โœจ Features
60
+
61
+ - ๐Ÿค– **Fully Automatic** - Cloudflare bundled, no installation needed
62
+ - ๐ŸŽฏ **Zero Config** - No project changes needed
63
+ - ๐Ÿ”— **Smart Proxy** - Bypasses Vite/React restrictions
64
+ - ๐ŸŒ **Cross-Platform** - Windows, macOS, Linux
65
+ - ๐Ÿš€ **Any Framework** - Node, React, Laravel, plain HTML, PHP/XAMPP
66
+ - ๐Ÿ“„ **HTML** - Default port 5500; built-in static server if none running
67
+ - ๐Ÿ˜ **PHP/XAMPP** - Port 80; supports htdocs subfolders (e.g. <http://localhost/YourProject/>)
68
+ - ๐Ÿ”„ **Multi-Service** - Cloudflare, Ngrok, LocalTunnel fallback
69
+ - ๐Ÿ”Œ **Multiple Ports** - DevTunnel-CLI supports multiple ports; auto-detects or lets you choose
70
+ - ๐Ÿ“น **Streaming Support** - Handles video/audio files
71
+
72
+ ---
73
+
74
+ ## ๐Ÿ’ก How to Use
75
+
76
+ **Important:** Run `devtunnel-cli` from the same directory as your project!
77
+
78
+ 1. **Install DevTunnel** (one-time): `npm i -g devtunnel-cli`
79
+ 2. **Go to your project**: `cd your-project` (Node, Laravel, HTML, or XAMPP folder)
80
+ 3. **Have your app running**: `npm run dev`, `php artisan serve`, or XAMPP. For HTML, optional โ€” DevTunnel can serve it.
81
+ 4. **Open a new terminal** in the same project directory
82
+ 5. **Run DevTunnel**: `devtunnel-cli` (auto-detects project type and port!)
83
+ 6. **Get your public URL** and share it! ๐ŸŒ
84
+
85
+ **Example (Node):**
86
+
87
+ ```bash
88
+ # Terminal 1
89
+ cd my-react-app
90
+ npm run dev
91
+
92
+ # Terminal 2 - same directory
93
+ cd my-react-app
94
+ devtunnel-cli
95
+ ```
96
+
97
+ **Works with:** Vite, React, Next.js, Express, NestJS, Laravel, plain HTML, PHP/XAMPP, and any HTTP/HTTPS server.
98
+
99
+ ---
100
+
101
+ ## ๐Ÿ“– Documentation
102
+
103
+ - [Features](docs/FEATURES.md)
104
+ - [Troubleshooting](docs/TROUBLESHOOTING.md)
105
+ - [Contributing](docs/CONTRIBUTING.md)
106
+ - [License](docs/LICENSE)
107
+
108
+ ---
109
+
110
+ ## ๐Ÿ› ๏ธ Requirements
111
+
112
+ - Node.js 16+ (download from [nodejs.org](https://nodejs.org))
113
+ - Internet connection
114
+ - Your dev server running
115
+
116
+ **No other installations needed!** Cloudflare is automatically bundled on first run.
117
+
118
+ ---
119
+
120
+ ## ๐Ÿ“„ License
121
+
122
+ MIT License - see [LICENSE](docs/LICENSE)
123
+
124
+ ---
125
+
126
+ **Latest on [npm](https://www.npmjs.com/package/devtunnel-cli)** | Made with โค๏ธŽ for developers worldwide
127
+
128
+ ---
129
+
130
+ ## ๐Ÿ” Search keywords
131
+
132
+ Find this project as: **DevTunnel**, **devtunnel**, **dev-tunnel**, **Dev-Tunnel**, **DevTunnel-CLI**, **devtunnel-cli**, **dev-tunnel-cli**, **Dev-Tunnel-CLI**. npm (install here): [devtunnel-cli](https://www.npmjs.com/package/devtunnel-cli) ยท Docs: [devtunnel-cli.vercel.app](https://devtunnel-cli.vercel.app) ยท GitHub: [maiz-an/DevTunnel-CLI](https://github.com/maiz-an/DevTunnel-CLI).
133
+
134
+ ---
135
+
136
+ ## ๐Ÿ“ฆ Links
137
+
138
+ - **Website**: [devtunnel-cli.vercel.app](https://devtunnel-cli.vercel.app)
139
+ - **npm**: [devtunnel-cli](https://www.npmjs.com/package/devtunnel-cli)
140
+ - **GitHub**: [maiz-an/DevTunnel-CLI](https://github.com/maiz-an/DevTunnel-CLI)
141
+ - **Issues**: [GitHub Issues](https://github.com/maiz-an/DevTunnel-CLI/issues)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "devtunnel-cli",
3
- "version": "3.0.44",
3
+ "version": "3.0.45",
4
4
  "type": "module",
5
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
6
  "main": "src/core/start.js",
@@ -18,7 +18,8 @@
18
18
  "tunnel": "node src/core/index.js",
19
19
  "sync-version": "node sync-version.js",
20
20
  "test": "node -e \"console.log('ok')\"",
21
- "prepublishOnly": "npm test"
21
+ "prepublishOnly": "npm test",
22
+ "postinstall": "node src/utils/postinstall-global-check.cjs"
22
23
  },
23
24
  "keywords": [
24
25
  "DevTunnel-CLI",
package/src/core/start.js CHANGED
@@ -17,10 +17,10 @@ function getPackageVersion() {
17
17
  const pkgPath = join(PROJECT_ROOT, "package.json");
18
18
  if (existsSync(pkgPath)) {
19
19
  const pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
20
- return pkg.version || "3.0.44";
20
+ return pkg.version || "3.0.45";
21
21
  }
22
22
  } catch (err) { }
23
- return "3.0.44";
23
+ return "3.0.45";
24
24
  }
25
25
 
26
26
  // Helper to run command
@@ -112,7 +112,7 @@ devtunnel-cli</code></pre>
112
112
  </ul>
113
113
 
114
114
  <hr>
115
- <p><small>Version <span id="pkg-version">3.0.44</span> | Made with โค๏ธŽ for developers worldwide</small></p>
115
+ <p><small>Version <span id="pkg-version">3.0.45</span> | Made with โค๏ธŽ for developers worldwide</small></p>
116
116
 
117
117
  <script>
118
118
  (async function () {
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+ // Warn if installed locally (without -g). For security, devtunnel-cli should be installed globally.
4
+ const path = require('path');
5
+ try {
6
+ const dir = __dirname; // e.g. .../node_modules/devtunnel-cli/src/utils
7
+ const inNodeModules = dir.includes('node_modules');
8
+ const npmPrefix = process.env.npm_config_prefix || (process.platform === 'win32' ? (process.env.APPDATA || '') + '\\npm' : '/usr/local');
9
+ const globalNodeModules = path.join(npmPrefix, 'node_modules');
10
+ const isGlobal = inNodeModules && (dir.startsWith(globalNodeModules) || path.resolve(dir).startsWith(path.resolve(globalNodeModules)));
11
+ if (inNodeModules && !isGlobal) {
12
+ console.error('\n \x1b[33mWARN: devtunnel-cli should be installed globally to avoid vulnerabilities.\x1b[0m');
13
+ console.error(' Run: \x1b[1mnpm i -g devtunnel-cli\x1b[0m\n');
14
+ }
15
+ } catch (e) { /* ignore */ }