instatunnel 1.0.37 → 1.0.38
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 +52 -60
- package/bin/instatunnel +0 -0
- package/bin/it +0 -0
- package/install.js +60 -22
- package/package.json +4 -6
- package/instatunnel-wrapper.js +0 -30
- package/it-wrapper.js +0 -30
- package/test.js +0 -35
- package/uninstall.js +0 -23
package/README.md
CHANGED
|
@@ -1,77 +1,69 @@
|
|
|
1
|
-
# InstaTunnel
|
|
1
|
+
# InstaTunnel CLI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> Expose your localhost to the internet instantly - the ngrok alternative that's 40% cheaper
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 🚀 Quick Start
|
|
6
6
|
|
|
7
|
-
- **Fast Setup**: One command to share your localhost
|
|
8
|
-
- **Custom Subdomains**: Get memorable URLs like `myapp.instatunnel.my`
|
|
9
|
-
- **Multiple Tunnels**: Run several tunnels simultaneously
|
|
10
|
-
- **Analytics Dashboard**: Track requests, bandwidth, and visitor stats
|
|
11
|
-
- **Extended Sessions**: 24+ hour sessions on free tier
|
|
12
|
-
- **Custom Domains**: Use your own domain (Pro tier)
|
|
13
|
-
- **Team Collaboration**: Share tunnels with your team
|
|
14
|
-
|
|
15
|
-
## Quick Start
|
|
16
|
-
|
|
17
|
-
### Install CLI
|
|
18
7
|
```bash
|
|
19
|
-
#
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
# Or with Go
|
|
23
|
-
go install github.com/instatunnel/cli@latest
|
|
24
|
-
```
|
|
8
|
+
# Install globally
|
|
9
|
+
npm install -g instatunnel
|
|
25
10
|
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
# Share your local port 3000
|
|
11
|
+
# Share your app instantly
|
|
29
12
|
instatunnel 3000
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
instatunnel 3000 --subdomain myapp
|
|
33
|
-
|
|
34
|
-
# Multiple tunnels
|
|
35
|
-
instatunnel 3000 &
|
|
36
|
-
instatunnel 8080 --subdomain api &
|
|
13
|
+
# or use the short alias
|
|
14
|
+
it 3000
|
|
37
15
|
```
|
|
38
16
|
|
|
39
|
-
##
|
|
40
|
-
|
|
41
|
-
### Prerequisites
|
|
42
|
-
- Go 1.21+
|
|
43
|
-
- Node.js 18+
|
|
44
|
-
- PostgreSQL 15+
|
|
45
|
-
- Redis 7+
|
|
46
|
-
- Docker & Docker Compose
|
|
17
|
+
## ✨ Features
|
|
47
18
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
19
|
+
- **🆓 Anonymous usage** - No signup required
|
|
20
|
+
- **⚡ Instant setup** - Works in under 30 seconds
|
|
21
|
+
- **🕐 24-hour sessions** - vs ngrok's 2-hour limit
|
|
22
|
+
- **🎨 Custom subdomains** - Free vs ngrok's paid feature
|
|
23
|
+
- **📱 QR codes** - Perfect for mobile testing
|
|
24
|
+
- **🔒 Password protection** - Secure your tunnels
|
|
25
|
+
- **🎯 Framework detection** - Auto-detect React, Next.js, Laravel
|
|
53
26
|
|
|
54
|
-
|
|
55
|
-
docker-compose up -d
|
|
27
|
+
## 📖 Usage Examples
|
|
56
28
|
|
|
57
|
-
|
|
58
|
-
|
|
29
|
+
```bash
|
|
30
|
+
# Basic tunneling
|
|
31
|
+
instatunnel 3000 # Share localhost:3000
|
|
32
|
+
it 8080 # Short alias for port 8080
|
|
33
|
+
|
|
34
|
+
# Framework shortcuts
|
|
35
|
+
instatunnel --react # Auto-detect React (port 3000)
|
|
36
|
+
instatunnel --next # Auto-detect Next.js (port 3000)
|
|
37
|
+
instatunnel --laravel # Auto-detect Laravel (port 8000)
|
|
38
|
+
|
|
39
|
+
# Security features
|
|
40
|
+
instatunnel 3000 --password secret # Password protect tunnel
|
|
41
|
+
instatunnel 3000 --auth user:pass # Basic authentication
|
|
42
|
+
|
|
43
|
+
# Mobile testing
|
|
44
|
+
instatunnel 3000 --qr # Show QR code for mobile
|
|
45
|
+
|
|
46
|
+
# Management
|
|
47
|
+
instatunnel --list # List active tunnels
|
|
48
|
+
instatunnel --kill myapp # Stop specific tunnel
|
|
49
|
+
instatunnel --share # Generate sharing templates
|
|
50
|
+
```
|
|
59
51
|
|
|
60
|
-
|
|
61
|
-
cd web && npm install && npm start
|
|
52
|
+
## 🆚 vs ngrok
|
|
62
53
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
54
|
+
| Feature | InstaTunnel | ngrok |
|
|
55
|
+
|---------|-------------|-------|
|
|
56
|
+
| **Anonymous usage** | ✅ No signup | ❌ Account required |
|
|
57
|
+
| **Session duration** | ✅ 24 hours | ❌ 2 hours |
|
|
58
|
+
| **Custom subdomains** | ✅ Free | ❌ Paid only |
|
|
59
|
+
| **Multiple tunnels** | ✅ 3 free | ❌ 1 free |
|
|
60
|
+
| **Setup time** | ✅ < 30 seconds | ❌ 2-3 minutes |
|
|
61
|
+
| **Pricing** | ✅ 40% cheaper | ❌ Expensive |
|
|
66
62
|
|
|
67
|
-
##
|
|
63
|
+
## 🌐 Website
|
|
68
64
|
|
|
69
|
-
|
|
70
|
-
- **CLI**: Cross-platform Go binary
|
|
71
|
-
- **Web**: React dashboard for analytics
|
|
72
|
-
- **Database**: PostgreSQL for data, Redis for sessions
|
|
73
|
-
- **Proxy**: Nginx for SSL termination and routing
|
|
65
|
+
Visit [instatunnel.my](https://instatunnel.my) for more information.
|
|
74
66
|
|
|
75
|
-
## License
|
|
67
|
+
## 📝 License
|
|
76
68
|
|
|
77
|
-
|
|
69
|
+
MIT
|
package/bin/instatunnel
CHANGED
|
Binary file
|
package/bin/it
ADDED
|
Binary file
|
package/install.js
CHANGED
|
@@ -28,24 +28,44 @@ function detectPlatform() {
|
|
|
28
28
|
const platform = os.platform();
|
|
29
29
|
const arch = os.arch();
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
let platformSuffix;
|
|
32
32
|
switch (platform) {
|
|
33
33
|
case 'linux':
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
return 'instatunnel-linux';
|
|
34
|
+
platformSuffix = 'linux';
|
|
35
|
+
break;
|
|
38
36
|
case 'darwin':
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
return 'instatunnel-macos';
|
|
37
|
+
platformSuffix = 'darwin';
|
|
38
|
+
break;
|
|
43
39
|
case 'win32':
|
|
44
|
-
|
|
40
|
+
platformSuffix = 'windows';
|
|
41
|
+
break;
|
|
42
|
+
case 'freebsd':
|
|
43
|
+
platformSuffix = 'freebsd';
|
|
44
|
+
break;
|
|
45
|
+
case 'openbsd':
|
|
46
|
+
platformSuffix = 'openbsd';
|
|
47
|
+
break;
|
|
45
48
|
default:
|
|
46
|
-
|
|
47
|
-
return 'instatunnel-linux';
|
|
49
|
+
throw new Error(`Unsupported platform: ${platform}`);
|
|
48
50
|
}
|
|
51
|
+
|
|
52
|
+
let archSuffix;
|
|
53
|
+
switch (arch) {
|
|
54
|
+
case 'x64':
|
|
55
|
+
archSuffix = 'amd64';
|
|
56
|
+
break;
|
|
57
|
+
case 'arm64':
|
|
58
|
+
archSuffix = 'arm64';
|
|
59
|
+
break;
|
|
60
|
+
case 'ia32':
|
|
61
|
+
archSuffix = '386';
|
|
62
|
+
break;
|
|
63
|
+
default:
|
|
64
|
+
throw new Error(`Unsupported architecture: ${arch}`);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const extension = platform === 'win32' ? '.exe' : '';
|
|
68
|
+
return `${BINARY_NAME}-${platformSuffix}-${archSuffix}${extension}`;
|
|
49
69
|
}
|
|
50
70
|
|
|
51
71
|
function downloadFile(url, outputPath) {
|
|
@@ -84,24 +104,42 @@ function downloadFile(url, outputPath) {
|
|
|
84
104
|
});
|
|
85
105
|
}
|
|
86
106
|
|
|
87
|
-
async function
|
|
107
|
+
async function downloadBinary() {
|
|
88
108
|
const binaryName = detectPlatform();
|
|
89
109
|
const binDir = path.join(__dirname, 'bin');
|
|
90
110
|
const isWindows = os.platform() === 'win32';
|
|
91
111
|
const outputPath = path.join(binDir, isWindows ? 'instatunnel.exe' : 'instatunnel');
|
|
92
|
-
|
|
112
|
+
|
|
113
|
+
// Create bin directory
|
|
114
|
+
if (!fs.existsSync(binDir)) {
|
|
115
|
+
fs.mkdirSync(binDir, { recursive: true });
|
|
116
|
+
}
|
|
93
117
|
|
|
94
118
|
log('🚀 Installing InstaTunnel CLI...', 'blue');
|
|
95
119
|
log(`📋 Platform: ${os.platform()}-${os.arch()}`, 'cyan');
|
|
96
|
-
log(`🎯 Using binary: ${binaryName}`, 'cyan');
|
|
97
120
|
|
|
98
|
-
//
|
|
99
|
-
|
|
100
|
-
|
|
121
|
+
// Try primary URL first
|
|
122
|
+
const primaryUrl = `${PRIMARY_URL}/${binaryName}`;
|
|
123
|
+
const fallbackUrl = `${FALLBACK_URL}/${binaryName}`;
|
|
124
|
+
|
|
125
|
+
try {
|
|
126
|
+
log('📥 Downloading from primary source...', 'blue');
|
|
127
|
+
await downloadFile(primaryUrl, outputPath);
|
|
128
|
+
} catch (primaryError) {
|
|
129
|
+
log(`⚠️ Primary download failed: ${primaryError.message}`, 'yellow');
|
|
130
|
+
log('📥 Trying fallback source (GitHub)...', 'blue');
|
|
131
|
+
|
|
132
|
+
try {
|
|
133
|
+
await downloadFile(fallbackUrl, outputPath);
|
|
134
|
+
} catch (fallbackError) {
|
|
135
|
+
throw new Error(`Both downloads failed:\n Primary: ${primaryError.message}\n Fallback: ${fallbackError.message}`);
|
|
136
|
+
}
|
|
101
137
|
}
|
|
102
138
|
|
|
103
|
-
//
|
|
104
|
-
fs.
|
|
139
|
+
// Verify binary was downloaded and is valid
|
|
140
|
+
if (!fs.existsSync(outputPath) || fs.statSync(outputPath).size === 0) {
|
|
141
|
+
throw new Error('Downloaded binary is invalid or empty');
|
|
142
|
+
}
|
|
105
143
|
|
|
106
144
|
// Make executable on Unix systems
|
|
107
145
|
if (!isWindows) {
|
|
@@ -220,7 +258,7 @@ module.exports = { test };
|
|
|
220
258
|
}
|
|
221
259
|
|
|
222
260
|
if (require.main === module) {
|
|
223
|
-
|
|
261
|
+
downloadBinary()
|
|
224
262
|
.then(() => {
|
|
225
263
|
createUninstallScript();
|
|
226
264
|
createTestScript();
|
|
@@ -229,7 +267,7 @@ if (require.main === module) {
|
|
|
229
267
|
log(`❌ Installation failed: ${err.message}`, 'red');
|
|
230
268
|
log('', 'reset');
|
|
231
269
|
log('🔧 Troubleshooting:', 'yellow');
|
|
232
|
-
log(' •
|
|
270
|
+
log(' • Check your internet connection', 'reset');
|
|
233
271
|
log(' • Try running: npm install -g instatunnel --verbose', 'reset');
|
|
234
272
|
log(' • Report issues: https://github.com/instatunnel/cli/issues', 'reset');
|
|
235
273
|
process.exit(1);
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "instatunnel",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.38",
|
|
4
4
|
"description": "Expose your localhost to the internet instantly - the ngrok alternative that's 40% cheaper with superior UX",
|
|
5
5
|
"main": "install.js",
|
|
6
6
|
"bin": {
|
|
7
|
-
"instatunnel": "./instatunnel
|
|
8
|
-
"it": "./it
|
|
7
|
+
"instatunnel": "./bin/instatunnel",
|
|
8
|
+
"it": "./bin/it"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"postinstall": "node install.js",
|
|
@@ -68,8 +68,6 @@
|
|
|
68
68
|
"preferGlobal": true,
|
|
69
69
|
"files": [
|
|
70
70
|
"install.js",
|
|
71
|
-
"instatunnel-wrapper.js",
|
|
72
|
-
"it-wrapper.js",
|
|
73
71
|
"uninstall.js",
|
|
74
72
|
"test.js",
|
|
75
73
|
"bin/",
|
|
@@ -78,4 +76,4 @@
|
|
|
78
76
|
"directories": {
|
|
79
77
|
"bin": "./bin"
|
|
80
78
|
}
|
|
81
|
-
}
|
|
79
|
+
}
|
package/instatunnel-wrapper.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const { spawn } = require('child_process');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
const os = require('os');
|
|
6
|
-
|
|
7
|
-
const platform = os.platform();
|
|
8
|
-
const binDir = path.join(__dirname, 'bin');
|
|
9
|
-
|
|
10
|
-
let binaryName = 'instatunnel';
|
|
11
|
-
let binaryPath = path.join(binDir, binaryName);
|
|
12
|
-
|
|
13
|
-
// Use the direct binary path
|
|
14
|
-
const child = spawn(binaryPath, process.argv.slice(2), {
|
|
15
|
-
stdio: 'inherit',
|
|
16
|
-
shell: false
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
child.on('error', (error) => {
|
|
20
|
-
console.error('Failed to start instatunnel:', error.message);
|
|
21
|
-
process.exit(1);
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
child.on('exit', (code, signal) => {
|
|
25
|
-
if (signal) {
|
|
26
|
-
process.kill(process.pid, signal);
|
|
27
|
-
} else {
|
|
28
|
-
process.exit(code || 0);
|
|
29
|
-
}
|
|
30
|
-
});
|
package/it-wrapper.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const { spawn } = require('child_process');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
const os = require('os');
|
|
6
|
-
|
|
7
|
-
const platform = os.platform();
|
|
8
|
-
const binDir = path.join(__dirname, 'bin');
|
|
9
|
-
|
|
10
|
-
let binaryName = 'it';
|
|
11
|
-
let binaryPath = path.join(binDir, binaryName);
|
|
12
|
-
|
|
13
|
-
// Use the direct binary path
|
|
14
|
-
const child = spawn(binaryPath, process.argv.slice(2), {
|
|
15
|
-
stdio: 'inherit',
|
|
16
|
-
shell: false
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
child.on('error', (error) => {
|
|
20
|
-
console.error('Failed to start it:', error.message);
|
|
21
|
-
process.exit(1);
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
child.on('exit', (code, signal) => {
|
|
25
|
-
if (signal) {
|
|
26
|
-
process.kill(process.pid, signal);
|
|
27
|
-
} else {
|
|
28
|
-
process.exit(code || 0);
|
|
29
|
-
}
|
|
30
|
-
});
|
package/test.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const { execSync } = require('child_process');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
const os = require('os');
|
|
6
|
-
|
|
7
|
-
function test() {
|
|
8
|
-
const binDir = path.join(__dirname, 'bin');
|
|
9
|
-
const extension = os.platform() === 'win32' ? '.exe' : '';
|
|
10
|
-
const instatunnelPath = path.join(binDir, 'instatunnel' + extension);
|
|
11
|
-
const itPath = path.join(binDir, 'it' + extension);
|
|
12
|
-
|
|
13
|
-
try {
|
|
14
|
-
// Test main command - execute binary directly, not with node
|
|
15
|
-
const helpOutput = execSync('"' + instatunnelPath + '" --help', { encoding: 'utf8', timeout: 5000 });
|
|
16
|
-
console.log('✅ instatunnel command works');
|
|
17
|
-
|
|
18
|
-
// Test alias - execute binary directly, not with node
|
|
19
|
-
const itHelpOutput = execSync('"' + itPath + '" --help', { encoding: 'utf8', timeout: 5000 });
|
|
20
|
-
console.log('✅ it alias works');
|
|
21
|
-
|
|
22
|
-
console.log('✅ All tests passed!');
|
|
23
|
-
return true;
|
|
24
|
-
} catch (error) {
|
|
25
|
-
console.error('❌ Test failed:', error.message);
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
if (require.main === module) {
|
|
31
|
-
const success = test();
|
|
32
|
-
process.exit(success ? 0 : 1);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
module.exports = { test };
|
package/uninstall.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const fs = require('fs');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
|
|
6
|
-
function cleanup() {
|
|
7
|
-
const binDir = path.join(__dirname, 'bin');
|
|
8
|
-
|
|
9
|
-
try {
|
|
10
|
-
if (fs.existsSync(binDir)) {
|
|
11
|
-
fs.rmSync(binDir, { recursive: true, force: true });
|
|
12
|
-
}
|
|
13
|
-
console.log('✅ InstaTunnel CLI uninstalled successfully!');
|
|
14
|
-
} catch (error) {
|
|
15
|
-
console.warn('⚠️ Some cleanup may be incomplete:', error.message);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
if (require.main === module) {
|
|
20
|
-
cleanup();
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
module.exports = { cleanup };
|