Hacker News new | past | comments | ask | show | jobs | submit login
Easy to Use Cloudflare Tunnels (cloudflare.com)
32 points by eldridgea on March 25, 2022 | hide | past | favorite | 3 comments



I used CF tunnels just the other day for the first time and they are pretty freaking cool. I think some of the docs could be improved (as I was throughly confused by "Applications" and how they related to tunnels, turns out I did not want applications but they are cool for self-hosted things. I have my own SSO setup for my self-hosted but I might consider moving to CF Applications in the future).

I used to create my own ngrok-type service (for just myself). I think with a little more wrapping code I could have an almost feature-parity with ngrok using CF tunnels but I'm happy with where I have it now. I have 2 tunnels (1 for server, 1 for client) that expose my local dev environment on a hostname I own (and use CF for the DNS). In the package.json for the client and server I have a npm run command to spin up the tunnel so I just cd to the project directory and run `npm run cf-tunnel` and then I'm good to go.

Why did I do this? 2 things, Apple Pay/Google Pay and HTTPS-gated things in general. Some things can work on localhost but a lot of things get fussy any want HTTPS even for development. Apple Pay needs you to validate a domain on HTTPS which means you either have to deploy and pray it works (yes, I have dev environments that are HTTPS but I hate adding so much turnaround time from "writing code"->"testing feature") or find a way to get your local dev served over a consistent hostname+HTTPS. You can do this with ngrok (paid, reserved subdomain) but I so rarely need this that I didn't love the idea of paying ~$60/yr for something I would use a handful of times at best.

I could have just wired up another Caddy entry on my local server but I prefer being able to turn off the tunnels easily (just kill the running `npm run cf-tunnel`) so I'm only exposing my local dev when I want to.


If anyone from CF is reading this, going to https://dash.teams.cloudflare.com/<id>/access/tunnels/add, typing name of the tunnel, and pressing Enter throws 'Tunnel name is required' (at least on macOS Safari.)

Clicking on 'Save tunnel' button works, but I was a bit baffled why it didn't accept the names I tried at first.


Why is Cloudflare control panel so slow? I love CF services and absolutely loath their CP.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: