From time to time you'll want to share your locally running app with some folks before it's ready to ship.
Features
π€ Free to use
π Not heavily rate limited
π HTTPS support
π Won't expose your IP
First make sure you have cloudflared
installed and setup. You can check out the cloudflared docs for setup instructions.
Now we can create our first tunnel by running the following command.
cloudflared tunnel create mycoolapp
Create a custom subdomain entry with ease just by running this command.
cloudflared tunnel route dns mycoolapp demo.boult.me
Once your app is running you can expose it via the tunnel.
cloudflared tunnel --url http://localhost:8080 run mycoolapp
Now you or a friend can visit the subdomain setup in one of the prior steps.
Top comments (7)
This is awesome, I use cloudflare a lot and I didn't know this existed!
That's kind of cool. I'm using a dynamic dns service and a handful of open ports right now to do the same basic thing. Cloudflare Tunnel sounds like a sounder (and cheaper) alternative. :)
Very nice. Gonna try this on Monday.
Whoah! Thank you so much for this! Now I can share my localhost without fear of my ip being leaked!!
There are a lot of services that do this, like localtunnel for example, which don't require you to do any weird setup involving "zero trust dashboards" or creating "applications".
I'm not sure how the DNS resolution in this is supposed to work - in your example, you're mapping to demo.boult.me but presumably you have to set that with a CNAME to something inside Cloudflare first.
I agree that there are less complicated solutions like ngrok or localtunnel that can achive the same thing but if you already use cloudflare it's another option to try out.
When you login to
cloudflared
CLI you select a domain on your account to use. The second command will create the CNAME for you but you can manually configure it AFAIK.Configure the CNAME manually
Ah, so you need to have a domain managed by Cloudflare already, gotcha.