Skip to content

Conversation

dario-valles
Copy link

@dario-valles dario-valles commented Jul 14, 2025

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
  • 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 tunnelmole and qrcode npm dependencies
    • Updated Vite config to allow external host access
    • Fixed port configuration for proper development setup

Screenshots

image

Testing

  1. Run npm install to install new dependencies
  2. Start the dev server with npm run dev
  3. Open Quick Settings panel (right sidebar)
  4. Toggle "Enable Tunnelmole" in Network Access section
  5. 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: true is only set in development mode
  • All tunnel endpoints are protected by authentication

- Add Tunnelmole npm package for creating secure tunnels
- Create tunnel service manager to handle tunnel lifecycle
- Add API endpoints for tunnel control (start/stop/status/share)
- Update QuickSettingsPanel with Network Access section
- Add toggle to enable/disable Tunnelmole from UI
- Display tunnel URL with copy and share functionality
- Generate QR codes for easy mobile access
- Update WebSocket connection to use tunnel URL when active
- Configure Vite to allow external host access (allowedHosts: true)
- Fix port configuration to use correct ports in development

This feature allows users to expose their local Claude Code UI instance
to the internet securely, making it accessible from mobile devices or
external networks with a simple toggle in the settings panel.
@viper151
Copy link
Contributor

@dario-valles I like the idea but why not use Localtunnel instead ?

https://theboroer.github.io/localtunnel-www/

@dario-valles
Copy link
Author

"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

@zuodajiang-1m
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants