devtunnel-cli 3.0.13 ā 3.0.15
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 +7 -7
- package/package.json +2 -2
- package/src/core/setup-cloudflared.js +41 -63
- package/src/core/start.js +2 -2
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
**1. Install DevTunnel (one-time setup):**
|
|
19
19
|
```bash
|
|
20
|
-
npm install -g devtunnel
|
|
20
|
+
npm install -g devtunnel
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
**2. Navigate to your project directory:**
|
|
@@ -35,7 +35,7 @@ npm run dev
|
|
|
35
35
|
**4. Run DevTunnel (in another terminal, same directory):**
|
|
36
36
|
```bash
|
|
37
37
|
cd your-project # Same directory where you run npm start
|
|
38
|
-
devtunnel # Auto-detects project and port!
|
|
38
|
+
devtunnel-cli # Auto-detects project and port!
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
**That's it!** DevTunnel will automatically detect your project and running dev server port.
|
|
@@ -56,13 +56,13 @@ devtunnel # Auto-detects project and port!
|
|
|
56
56
|
|
|
57
57
|
## š” How to Use
|
|
58
58
|
|
|
59
|
-
**Important:** Run `devtunnel` from the same directory where you run `npm start` or `npm run dev`!
|
|
59
|
+
**Important:** Run `devtunnel-cli` from the same directory where you run `npm start` or `npm run dev`!
|
|
60
60
|
|
|
61
61
|
1. **Install DevTunnel** (one-time): `npm install -g devtunnel-cli`
|
|
62
62
|
2. **Go to your project**: `cd your-project`
|
|
63
63
|
3. **Start your dev server**: `npm start` or `npm run dev` (keep this running)
|
|
64
64
|
4. **Open a new terminal** in the same project directory
|
|
65
|
-
5. **Run DevTunnel**: `devtunnel` (auto-detects everything!)
|
|
65
|
+
5. **Run DevTunnel**: `devtunnel-cli` (auto-detects everything!)
|
|
66
66
|
6. **Get your public URL** and share it! š
|
|
67
67
|
|
|
68
68
|
**Example:**
|
|
@@ -106,19 +106,19 @@ MIT License - see [LICENSE](docs/LICENSE)
|
|
|
106
106
|
|
|
107
107
|
---
|
|
108
108
|
|
|
109
|
-
**Version 3.0.
|
|
109
|
+
**Version 3.0.14** | Made with ā¤ļø for developers worldwide
|
|
110
110
|
|
|
111
111
|
---
|
|
112
112
|
|
|
113
113
|
## š Search Keywords
|
|
114
114
|
|
|
115
|
-
**DevTunnel** | **dev tunnel** | **localhost tunnel** | **cloudflare tunnel** | **ngrok alternative** | **port forwarding** | **local development** | **vite tunnel** | **react dev server** | **nextjs tunnel** | **npm devtunnel** | **
|
|
115
|
+
**DevTunnel** | **dev tunnel** | **localhost tunnel** | **cloudflare tunnel** | **ngrok alternative** | **port forwarding** | **local development** | **vite tunnel** | **react dev server** | **nextjs tunnel** | **npm devtunnel** | **share localhost** | **development tools** | **zero config tunnel**
|
|
116
116
|
|
|
117
117
|
---
|
|
118
118
|
|
|
119
119
|
## š¦ Installation & Links
|
|
120
120
|
|
|
121
|
-
- **npm Package**: [devtunnel
|
|
121
|
+
- **npm Package**: [devtunnel](https://www.npmjs.com/package/devtunnel)
|
|
122
122
|
- **GitHub Repository**: [maiz-an/DevTunnel](https://github.com/maiz-an/DevTunnel)
|
|
123
123
|
- **GitHub Pages**: [maiz-an.github.io/DevTunnel](https://maiz-an.github.io/DevTunnel/)
|
|
124
124
|
- **Official Website**: [devtunnel.vercel.app](https://devtunnel.vercel.app)
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "devtunnel-cli",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.15",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "DevTunnel - Share local dev servers worldwide. Zero configuration tunnel for any framework. Install via npm: npm install -g devtunnel-cli. Works with Vite, React, Next.js, Express, NestJS and more.",
|
|
6
6
|
"main": "src/core/start.js",
|
|
7
7
|
"bin": {
|
|
8
|
-
"devtunnel": "src/core/RUN.js"
|
|
8
|
+
"devtunnel-cli": "src/core/RUN.js"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"start": "node src/core/RUN.js",
|
|
@@ -78,42 +78,17 @@ async function isAdmin() {
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
try {
|
|
90
|
-
const script = `
|
|
91
|
-
Start-Process -FilePath "node" -ArgumentList "${process.argv[1]}" -Verb RunAs -Wait
|
|
92
|
-
`;
|
|
93
|
-
|
|
94
|
-
const { spawn } = await import('child_process');
|
|
95
|
-
return new Promise((resolve) => {
|
|
96
|
-
const proc = spawn('powershell', [
|
|
97
|
-
'-NoProfile',
|
|
98
|
-
'-NonInteractive',
|
|
99
|
-
'-ExecutionPolicy', 'Bypass',
|
|
100
|
-
'-Command', script
|
|
101
|
-
], {
|
|
102
|
-
stdio: 'inherit',
|
|
103
|
-
shell: false
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
proc.on('close', (code) => {
|
|
107
|
-
resolve(code === 0);
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
proc.on('error', () => {
|
|
111
|
-
resolve(false);
|
|
112
|
-
});
|
|
113
|
-
});
|
|
114
|
-
} catch {
|
|
115
|
-
return false;
|
|
81
|
+
function showPermissionSolutions(dirPath) {
|
|
82
|
+
console.log('\nš” Solutions:');
|
|
83
|
+
if (process.platform === 'win32') {
|
|
84
|
+
console.log(' 1. Run terminal as Administrator (Right-click ā Run as administrator)');
|
|
85
|
+
console.log(' 2. DevTunnel will automatically request admin privileges if needed');
|
|
86
|
+
} else {
|
|
87
|
+
console.log(' 1. Run with sudo: sudo npm install -g devtunnel-cli');
|
|
116
88
|
}
|
|
89
|
+
console.log(' 2. Check if antivirus is blocking file writes');
|
|
90
|
+
console.log(' 3. Check folder permissions for:', dirPath);
|
|
91
|
+
console.log(' 4. Try installing manually: https://github.com/cloudflare/cloudflared/releases\n');
|
|
117
92
|
}
|
|
118
93
|
|
|
119
94
|
function downloadFile(url, dest, retryCount = 0) {
|
|
@@ -273,30 +248,43 @@ async function downloadWithRetry(urls, dest, maxRetries = 3) {
|
|
|
273
248
|
if (err.message.includes('Permission denied') || err.message.includes('EPERM') || err.message.includes('EACCES')) {
|
|
274
249
|
console.log(`\nā Permission Error: ${err.message}`);
|
|
275
250
|
|
|
276
|
-
if (process.platform === 'win32') {
|
|
251
|
+
if (process.platform === 'win32' && retry === 0) {
|
|
277
252
|
const admin = await isAdmin();
|
|
278
253
|
if (!admin) {
|
|
279
254
|
console.log('\nš Attempting to request administrator privileges...');
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
255
|
+
console.log(' Please click "Yes" on the UAC prompt\n');
|
|
256
|
+
|
|
257
|
+
try {
|
|
258
|
+
const nodePath = process.execPath;
|
|
259
|
+
const scriptPath = process.argv[1];
|
|
260
|
+
const proc = spawn('powershell', [
|
|
261
|
+
'-NoProfile',
|
|
262
|
+
'-NonInteractive',
|
|
263
|
+
'-ExecutionPolicy', 'Bypass',
|
|
264
|
+
'-Command', `Start-Process -FilePath "${nodePath}" -ArgumentList "${scriptPath}" -Verb RunAs -Wait`
|
|
265
|
+
], {
|
|
266
|
+
stdio: 'inherit',
|
|
267
|
+
shell: false
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
proc.on('close', () => {
|
|
271
|
+
process.exit(0);
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
proc.on('error', () => {
|
|
275
|
+
console.log('\nā ļø Could not elevate privileges automatically');
|
|
276
|
+
showPermissionSolutions(path.dirname(dest));
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
return false;
|
|
280
|
+
} catch {
|
|
281
|
+
showPermissionSolutions(path.dirname(dest));
|
|
282
|
+
throw err;
|
|
287
283
|
}
|
|
288
284
|
}
|
|
289
285
|
}
|
|
290
286
|
|
|
291
|
-
|
|
292
|
-
if (process.platform === 'win32') {
|
|
293
|
-
console.log(' 1. Run terminal as Administrator (Right-click ā Run as administrator)');
|
|
294
|
-
} else {
|
|
295
|
-
console.log(' 1. Run with sudo: sudo npm install -g devtunnel-cli');
|
|
296
|
-
}
|
|
297
|
-
console.log(' 2. Check if antivirus is blocking file writes');
|
|
298
|
-
console.log(' 3. Check folder permissions for:', path.dirname(dest));
|
|
299
|
-
console.log(' 4. Try installing manually: https://github.com/cloudflare/cloudflared/releases\n');
|
|
287
|
+
showPermissionSolutions(path.dirname(dest));
|
|
300
288
|
throw err;
|
|
301
289
|
} else if (err.message.includes('ENOTFOUND') || err.message.includes('ECONNREFUSED')) {
|
|
302
290
|
console.log(`\nā Network error: ${err.message}`);
|
|
@@ -417,17 +405,7 @@ export async function setupCloudflared() {
|
|
|
417
405
|
console.error(`Reason: ${err.message}\n`);
|
|
418
406
|
|
|
419
407
|
if (err.message.includes('Permission denied') || err.message.includes('EPERM') || err.message.includes('EACCES')) {
|
|
420
|
-
|
|
421
|
-
if (process.platform === 'win32') {
|
|
422
|
-
console.log(' 1. Run terminal as Administrator (Right-click ā Run as administrator)');
|
|
423
|
-
console.log(' 2. DevTunnel will automatically request admin privileges if needed');
|
|
424
|
-
} else {
|
|
425
|
-
console.log(' 1. Run with sudo: sudo npm install -g devtunnel-cli');
|
|
426
|
-
}
|
|
427
|
-
console.log(' 2. Check antivirus is not blocking file writes');
|
|
428
|
-
console.log(' 3. Check folder permissions for:', path.dirname(binaryPath));
|
|
429
|
-
console.log(' 4. Try installing Cloudflare manually:');
|
|
430
|
-
console.log(' https://github.com/cloudflare/cloudflared/releases\n');
|
|
408
|
+
showPermissionSolutions(path.dirname(binaryPath));
|
|
431
409
|
} else {
|
|
432
410
|
console.log('š” Troubleshooting:');
|
|
433
411
|
console.log(' 1. Check internet connection');
|
package/src/core/start.js
CHANGED
|
@@ -183,12 +183,12 @@ async function main() {
|
|
|
183
183
|
// Show ASCII logo
|
|
184
184
|
showLogo();
|
|
185
185
|
|
|
186
|
-
console.log("DevTunnel v3.0.
|
|
186
|
+
console.log("DevTunnel v3.0.14");
|
|
187
187
|
console.log("Share your local dev servers worldwide");
|
|
188
188
|
console.log("");
|
|
189
189
|
console.log("āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā");
|
|
190
190
|
console.log("Repository: https://github.com/maiz-an/DevTunnel");
|
|
191
|
-
console.log("npm Package: https://www.npmjs.com/package/devtunnel
|
|
191
|
+
console.log("npm Package: https://www.npmjs.com/package/devtunnel");
|
|
192
192
|
console.log("Website: https://devtunnel.vercel.app");
|
|
193
193
|
console.log("āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā");
|
|
194
194
|
console.log("");
|