feat: Add Tunnelmole integration for remote access
Summary
- Adds Tunnelmole integration to expose local Claude Code UI instances to the internet
- Provides easy mobile access through QR codes
- Seamless toggle in the settings panel
Motivation
Users often need to access their Claude Code UI instance from mobile devices or external networks. This feature provides a secure and easy way to create temporary tunnels without complex network configuration.
Changes
-
Backend:
- Added Tunnelmole service manager (
server/services/tunnelService.js) - Created API endpoints for tunnel control (
server/routes/tunnel.js) - Updated server to support tunneling in development mode
- Added Tunnelmole service manager (
-
Frontend:
- Added Network Access section to QuickSettingsPanel
- Implemented tunnel toggle with real-time status updates
- Added QR code generation for easy mobile scanning
- Updated WebSocket connection to use tunnel URLs when active
-
Configuration:
- Added
tunnelmoleandqrcodenpm dependencies - Updated Vite config to allow external host access
- Fixed port configuration for proper development setup
- Added
Screenshots
Testing
- Run
npm installto install new dependencies - Start the dev server with
npm run dev - Open Quick Settings panel (right sidebar)
- Toggle "Enable Tunnelmole" in Network Access section
- Use the displayed URL or scan the QR code to access from external devices
Security Considerations
- Tunnel URLs are temporary and only active while enabled
- Vite's
allowedHosts: trueis only set in development mode - All tunnel endpoints are protected by authentication
@dario-valles I like the idea but why not use Localtunnel instead ?
https://theboroer.github.io/localtunnel-www/
"Good question! I wasn't aware of Localtunnel before. Both are indeed open source, which is great. I chose Tunnelmole because:
It offers persistent custom domains (paid tier) so you can keep the same URL across sessions Has multiple installation options (npm, binary, or curl) vs Localtunnel's npm-only More actively maintained with recent updates Can be fully self-hosted (both client and server)
That said, Localtunnel is completely free and simpler if you just need basic tunneling. I'm not affiliated with either service - just picked what worked best for my needs. If you want i could change it to use localtunnel
There’s also Cloudflare Tunnel, but there are too many options. I think you can run this project in Docker, expose the port, and host it on a server with a public IP.
In a pure environment, tunnels may not be necessary.