lan-gateway
v1.0.2
Published
Share your localhost services over WiFi - Multi-app HTTPS gateway for local development
Maintainers
Readme
LAN Gateway
Access your localhost apps from any device on your WiFi. Vibe coded with Antigravity
Why Use This?
Testing your web app on your phone usually means:
- Exposing it to the internet (ngrok, localtunnel)
- Dealing with public URLs and security concerns
- Paying for tunneling services
LAN Gateway keeps everything local. Your apps stay on your network, accessible only to devices on your WiFi.
What It Does
- Runs multiple apps on your laptop
- Makes them accessible via HTTPS on your WiFi
- Auto-assigns ports (9000, 9001, 9002...)
- Optionally starts your apps for you
Install
npm install -g lan-gatewayQuick Start
# Create config
lan-gateway init
# Edit proxy-config.json (see below)
# Start gateway
lan-gateway startAccess your apps at https://YOUR_IP:9000, https://YOUR_IP:9001, etc.
Configuration
Edit proxy-config.json:
{
"apps": [
{
"name": "my-app",
"gatewayPort": "",
"services": {
"frontend": {
"enabled": true,
"url": "http://localhost:5173",
"path": "/",
"startCommand": "npm run dev",
"workingDirectory": "D:/Projects/MyApp/frontend"
},
"backend": {
"enabled": true,
"url": "http://localhost:3000",
"path": "/api",
"startCommand": "npm run dev",
"workingDirectory": "D:/Projects/MyApp/backend"
}
}
}
]
}Fields:
gatewayPort: Leave empty for auto-assign (9000, 9001...) or specify a porturl: Where your service runs locallypath: URL path for routing (/for frontend,/apifor backend)startCommand: Optional - command to start your serviceworkingDirectory: Required if usingstartCommand
Multiple Apps
Each app gets its own gateway port:
{
"apps": [
{
"name": "main-app",
"gatewayPort": "",
"services": { ... }
},
{
"name": "test-app",
"gatewayPort": "",
"services": { ... }
}
]
}Result:
https://YOUR_IP:9000→ main-apphttps://YOUR_IP:9001→ test-app
Security Warning
First time you access the gateway, your browser shows a security warning. This is normal - we use self-signed certificates.
Click "Advanced" → "Proceed". You only see this once per device.
Troubleshooting
Permission Denied Error (Windows)
If you get EACCES: permission denied when starting:
Cause: Antivirus software (Quick Heal, Avast, etc.) blocking Node.js from binding to network ports.
Solution:
- Add Node.js to your antivirus whitelist/exceptions
- Or temporarily disable network protection
- Or run PowerShell as Administrator
Port Already in Use
If your specified port is busy, the gateway will automatically try the next available port and notify you.
Service Won't Start
- Check that
workingDirectorypath exists - Verify
startCommandworks when run manually - Check service logs in verbose mode: set
"verbosity": "verbose"in config
Add to .gitignore
.gateway-cert/How It Works
- Gateway creates HTTPS servers on your LAN
- Routes requests to your localhost services
- Optionally starts services if
startCommandis set - Stops everything when you press Ctrl+C
License
MIT
