instatunnel 1.0.38 → 1.0.40
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 +60 -52
- package/bin/instatunnel +0 -0
- package/install.js +22 -60
- package/instatunnel-wrapper.js +30 -0
- package/it-wrapper.js +30 -0
- package/package.json +6 -4
- package/test.js +35 -0
- package/uninstall.js +23 -0
- package/bin/it +0 -0
package/README.md
CHANGED
|
@@ -1,69 +1,77 @@
|
|
|
1
|
-
# InstaTunnel
|
|
1
|
+
# InstaTunnel
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
InstaTunnel is a fast, reliable, and developer-friendly tunneling service that makes your localhost accessible from anywhere on the internet. Built as an open-source alternative to ngrok with better pricing and more generous free tier.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Features
|
|
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
|
|
7
18
|
```bash
|
|
8
|
-
#
|
|
9
|
-
|
|
19
|
+
# Download latest release
|
|
20
|
+
curl -sSL https://install.instatunnel.my | bash
|
|
10
21
|
|
|
11
|
-
#
|
|
12
|
-
instatunnel
|
|
13
|
-
# or use the short alias
|
|
14
|
-
it 3000
|
|
22
|
+
# Or with Go
|
|
23
|
+
go install github.com/instatunnel/cli@latest
|
|
15
24
|
```
|
|
16
25
|
|
|
17
|
-
|
|
26
|
+
### Start Tunneling
|
|
27
|
+
```bash
|
|
28
|
+
# Share your local port 3000
|
|
29
|
+
instatunnel 3000
|
|
30
|
+
|
|
31
|
+
# Use custom subdomain
|
|
32
|
+
instatunnel 3000 --subdomain myapp
|
|
18
33
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
- **🎯 Framework detection** - Auto-detect React, Next.js, Laravel
|
|
34
|
+
# Multiple tunnels
|
|
35
|
+
instatunnel 3000 &
|
|
36
|
+
instatunnel 8080 --subdomain api &
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Development
|
|
26
40
|
|
|
27
|
-
|
|
41
|
+
### Prerequisites
|
|
42
|
+
- Go 1.21+
|
|
43
|
+
- Node.js 18+
|
|
44
|
+
- PostgreSQL 15+
|
|
45
|
+
- Redis 7+
|
|
46
|
+
- Docker & Docker Compose
|
|
28
47
|
|
|
48
|
+
### Local Setup
|
|
29
49
|
```bash
|
|
30
|
-
#
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
```
|
|
50
|
+
# Clone repository
|
|
51
|
+
git clone https://github.com/instatunnel/instatunnel
|
|
52
|
+
cd instatunnel
|
|
51
53
|
|
|
52
|
-
|
|
54
|
+
# Start services
|
|
55
|
+
docker-compose up -d
|
|
53
56
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
# Run server
|
|
58
|
+
cd server && go run cmd/main.go
|
|
59
|
+
|
|
60
|
+
# Run web dashboard
|
|
61
|
+
cd web && npm install && npm start
|
|
62
|
+
|
|
63
|
+
# Build CLI
|
|
64
|
+
cd cli && go build -o instatunnel cmd/main.go
|
|
65
|
+
```
|
|
62
66
|
|
|
63
|
-
##
|
|
67
|
+
## Architecture
|
|
64
68
|
|
|
65
|
-
|
|
69
|
+
- **Server**: Go backend with WebSocket tunneling
|
|
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
|
|
66
74
|
|
|
67
|
-
##
|
|
75
|
+
## License
|
|
68
76
|
|
|
69
|
-
MIT
|
|
77
|
+
Open source under MIT License.
|
package/bin/instatunnel
CHANGED
|
Binary file
|
package/install.js
CHANGED
|
@@ -28,44 +28,24 @@ function detectPlatform() {
|
|
|
28
28
|
const platform = os.platform();
|
|
29
29
|
const arch = os.arch();
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
// Map to our actual binary names in the bin/ directory
|
|
32
32
|
switch (platform) {
|
|
33
33
|
case 'linux':
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
if (arch === 'arm64') {
|
|
35
|
+
return 'instatunnel-linux-arm64';
|
|
36
|
+
}
|
|
37
|
+
return 'instatunnel-linux';
|
|
36
38
|
case 'darwin':
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
if (arch === 'arm64') {
|
|
40
|
+
return 'instatunnel-macos-arm64';
|
|
41
|
+
}
|
|
42
|
+
return 'instatunnel-macos';
|
|
39
43
|
case 'win32':
|
|
40
|
-
|
|
41
|
-
break;
|
|
42
|
-
case 'freebsd':
|
|
43
|
-
platformSuffix = 'freebsd';
|
|
44
|
-
break;
|
|
45
|
-
case 'openbsd':
|
|
46
|
-
platformSuffix = 'openbsd';
|
|
47
|
-
break;
|
|
44
|
+
return 'instatunnel-windows.exe';
|
|
48
45
|
default:
|
|
49
|
-
|
|
46
|
+
// Fallback to linux binary for other Unix-like systems
|
|
47
|
+
return 'instatunnel-linux';
|
|
50
48
|
}
|
|
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}`;
|
|
69
49
|
}
|
|
70
50
|
|
|
71
51
|
function downloadFile(url, outputPath) {
|
|
@@ -104,42 +84,24 @@ function downloadFile(url, outputPath) {
|
|
|
104
84
|
});
|
|
105
85
|
}
|
|
106
86
|
|
|
107
|
-
async function
|
|
87
|
+
async function setupBinary() {
|
|
108
88
|
const binaryName = detectPlatform();
|
|
109
89
|
const binDir = path.join(__dirname, 'bin');
|
|
110
90
|
const isWindows = os.platform() === 'win32';
|
|
111
91
|
const outputPath = path.join(binDir, isWindows ? 'instatunnel.exe' : 'instatunnel');
|
|
112
|
-
|
|
113
|
-
// Create bin directory
|
|
114
|
-
if (!fs.existsSync(binDir)) {
|
|
115
|
-
fs.mkdirSync(binDir, { recursive: true });
|
|
116
|
-
}
|
|
92
|
+
const sourcePath = path.join(binDir, binaryName);
|
|
117
93
|
|
|
118
94
|
log('🚀 Installing InstaTunnel CLI...', 'blue');
|
|
119
95
|
log(`📋 Platform: ${os.platform()}-${os.arch()}`, 'cyan');
|
|
96
|
+
log(`🎯 Using binary: ${binaryName}`, 'cyan');
|
|
120
97
|
|
|
121
|
-
//
|
|
122
|
-
|
|
123
|
-
|
|
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
|
-
}
|
|
98
|
+
// Check if the platform-specific binary exists
|
|
99
|
+
if (!fs.existsSync(sourcePath)) {
|
|
100
|
+
throw new Error(`Binary for your platform (${binaryName}) not found. Supported platforms: linux, macOS, Windows (x64/arm64)`);
|
|
137
101
|
}
|
|
138
102
|
|
|
139
|
-
//
|
|
140
|
-
|
|
141
|
-
throw new Error('Downloaded binary is invalid or empty');
|
|
142
|
-
}
|
|
103
|
+
// Copy the platform-specific binary to the standard name
|
|
104
|
+
fs.copyFileSync(sourcePath, outputPath);
|
|
143
105
|
|
|
144
106
|
// Make executable on Unix systems
|
|
145
107
|
if (!isWindows) {
|
|
@@ -258,7 +220,7 @@ module.exports = { test };
|
|
|
258
220
|
}
|
|
259
221
|
|
|
260
222
|
if (require.main === module) {
|
|
261
|
-
|
|
223
|
+
setupBinary()
|
|
262
224
|
.then(() => {
|
|
263
225
|
createUninstallScript();
|
|
264
226
|
createTestScript();
|
|
@@ -267,7 +229,7 @@ if (require.main === module) {
|
|
|
267
229
|
log(`❌ Installation failed: ${err.message}`, 'red');
|
|
268
230
|
log('', 'reset');
|
|
269
231
|
log('🔧 Troubleshooting:', 'yellow');
|
|
270
|
-
log(' •
|
|
232
|
+
log(' • Your platform may not be supported yet', 'reset');
|
|
271
233
|
log(' • Try running: npm install -g instatunnel --verbose', 'reset');
|
|
272
234
|
log(' • Report issues: https://github.com/instatunnel/cli/issues', 'reset');
|
|
273
235
|
process.exit(1);
|
|
@@ -0,0 +1,30 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
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/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "instatunnel",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.40",
|
|
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": "./
|
|
8
|
-
"it": "./
|
|
7
|
+
"instatunnel": "./instatunnel-wrapper.js",
|
|
8
|
+
"it": "./it-wrapper.js"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"postinstall": "node install.js",
|
|
@@ -68,6 +68,8 @@
|
|
|
68
68
|
"preferGlobal": true,
|
|
69
69
|
"files": [
|
|
70
70
|
"install.js",
|
|
71
|
+
"instatunnel-wrapper.js",
|
|
72
|
+
"it-wrapper.js",
|
|
71
73
|
"uninstall.js",
|
|
72
74
|
"test.js",
|
|
73
75
|
"bin/",
|
|
@@ -76,4 +78,4 @@
|
|
|
76
78
|
"directories": {
|
|
77
79
|
"bin": "./bin"
|
|
78
80
|
}
|
|
79
|
-
}
|
|
81
|
+
}
|
package/test.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
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 };
|
package/bin/it
DELETED
|
Binary file
|