The Deska blog
Tailscale Funnel: Sharing Localhost Selectively
Learn how to use Tailscale Funnel for sharing localhost selectively with the public internet while maintaining a secure developer workflow.
· 10 min read
Sharing a local development server with the outside world has traditionally required either complex firewall configurations or third party tunneling services. Tailscale Funnel provides a streamlined way of sharing localhost selectively, allowing developers to expose specific local ports to the public internet without opening their entire network. This approach is particularly useful for testing webhooks, demoing work to clients, or verifying mobile connectivity during the development phase. Unlike a standard VPN connection that requires the client to be part of your private mesh network, Funnel makes your local services accessible to anyone with the URL.
Understanding the Tailscale Funnel Architecture
Tailscale Funnel builds upon the existing Tailscale infrastructure by acting as an ingress point. When you enable Funnel on a specific node, Tailscale nodes located at the edge of their network receive traffic on your behalf and forward it through the encrypted WireGuard tunnel to your local machine. This ensures that your actual IP address remains hidden and your local network stays protected behind the Tailscale coordination server.
The mechanism differs from traditional port forwarding because it does not rely on your router settings. Instead, it creates a temporary public DNS entry. This entry points to Tailscale relay servers which then route the traffic to your device. Security is handled through the Tailscale ACL (Access Control List) policy, giving you granular control over which devices can initiate these funnels.
Use Cases for Selective Localhost Sharing
There are several scenarios where exposing a local port to the public internet is more efficient than deploying to a staging environment.
- Webhook Integration: Testing services like Stripe, GitHub, or Twilio requires a public URL so their servers can send POST requests to your application.
- Mobile Testing: While you can use a mobile app to monitor your workspace, sometimes you need to test how a site renders in a standard mobile browser without installing extra software.
- Client Previews: Providing a live link to a feature in progress allows for immediate feedback without the overhead of a full CI/CD pipeline execution.
- Cross Device Debugging: Checking how an API responds to requests from different geographic locations or network conditions.
Technical Configuration and Security
To start sharing localhost selectively, you must first ensure that Tailscale is running and that you have administrative rights to modify the tailnet policy. The process involves two main steps: enabling the Funnel feature in the access control policy and then running the command line instruction to point to your local port.
The command usually follows a structure where you define the port and the privacy level. For example, running tailscale funnel 3000 will take traffic from the public internet and direct it to your local port 3000. It is important to remember that once a Funnel is active, anyone with the generated URL can access that specific port. You should never expose ports that contain sensitive data or administrative interfaces without additional authentication layers.
Comparing Tunneling Methods
While Tailscale Funnel is a robust choice, other tools in the ecosystem offer different advantages. Choosing the right one depends on your specific local-first requirements and how much control you need over the ingress traffic.
| Feature | Tailscale Funnel | Ngrok | Cloudflare Tunnel |
|---|---|---|---|
| Setup Complexity | Low if using Tailscale | Very Low | Moderate |
| Authentication | Tailnet ACLs | Token based | Cloudflare Access |
| Persistent URLs | Yes (Deterministic) | Paid Tier Only | Yes |
| Protocol Support | HTTP/HTTPS/TCP | Multi-protocol | Multi-protocol |
Tailscale is often preferred by those who already use it for internal networking because it consolidates tools. Ngrok is frequently praised for its inspection UI which allows you to replay requests. Cloudflare offers deep integration with their security suite, making it a strong choice for more permanent deployments. These tools differ in approach, but they all solve the fundamental problem of bypassing NAT (Network Address Translation).
Enhancing Workflow with Deska
Managing multiple terminals and browser windows while testing a public tunnel can become chaotic. Deska provides a structured environment to handle these tasks. By using the canvas interface, you can place a terminal running your local server, another terminal managing the Tailscale Funnel, and a browser panel showing the public URL all in one view.
Deska allows you to organize these components into logical workspaces. This is particularly effective when you are using agents to debug incoming webhook payloads. You can have an AI panel monitoring your logs and suggesting fixes in real time. Because Deska is a local-first application, your code and sensitive environment variables remain on your machine even while you are exposing a specific port for testing.
The terminals in Deska support multiple sessions, which means you can keep your Funnel active in the background while you continue to interact with your version control system. If you need to check the status of your tunnel while away from your desk, the mobile companion app allows you to monitor your active sessions through a secure relay.
Best Practices for Public Exposure
Exposing localhost is inherently risky if not handled with care. Always follow these safety guidelines:
- Use HTTPS: Tailscale Funnel provides automatic TLS certificates, ensuring that data in transit is encrypted.
- Limit Exposure Time: Turn off the funnel as soon as the testing session is over to minimize the attack surface.
- Sanitize Input: Since the port is public, your application will receive traffic from automated bots and scanners. Ensure your code handles unexpected or malicious payloads gracefully.
- Monitor Logs: Keep a close watch on your application logs to detect any unauthorized access attempts.
Using Ask Deska can help you automate these checks. You can use voice commands to "close all active tunnels" or "show me the last ten requests to port 3000" to maintain awareness of your environment. Integrating these habits into your developer workflow ensures that productivity does not come at the cost of security.
FAQ
How to share localhost with Tailscale Funnel?
You must first enable Funnel in your Tailscale admin console via the ACL policy. Once enabled, use the command line to run tailscale funnel <port> which generates a public URL that routes traffic to your local machine.
Is Tailscale Funnel secure for production?
It is designed primarily for development and testing. While it uses encrypted tunnels, exposing a local port to the internet requires the application itself to be secure. For production, dedicated hosting or more restrictive Cloudflare tunnels are often more appropriate.
Can I use Tailscale Funnel without a fixed IP?
Yes, Tailscale handles the dynamic nature of residential or mobile IP addresses. It uses its own relay network and stable DNS names to ensure your funnel remains accessible even if your local network configuration changes.
Streamline Your Development Environment
Setting up tunnels and managing local services is easier when your tools work together. Deska offers a flexible, infinite canvas where you can orchestrate your entire stack. From running AI coding agents to managing secure remote access, the workspace is built to stay out of your way.
Download Deska for Mac, Windows, or Linux to start building in a more organized, local-first environment.