-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtunnel.js
More file actions
36 lines (29 loc) · 765 Bytes
/
tunnel.js
File metadata and controls
36 lines (29 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
const localtunnel = require('localtunnel');
async function startTunnel() {
console.log('Starting localtunnel...');
const tunnel = await localtunnel({
port: 3456,
subdomain: 'agentmail' // Try to get consistent subdomain
});
console.log('');
console.log('🚀 Agent Mail is PUBLIC!');
console.log('');
console.log('URL:', tunnel.url);
console.log('');
tunnel.on('close', () => {
console.log('Tunnel closed');
});
tunnel.on('error', (err) => {
console.error('Tunnel error:', err);
});
// Handle shutdown
process.on('SIGINT', () => {
console.log('Stopping tunnel...');
tunnel.close();
process.exit();
});
}
startTunnel().catch(err => {
console.error('Error:', err);
process.exit(1);
});