Live data from Hacker News

Exposing a web service with Cloudflare Tunnel

erisa.dev

11–20 of 186 posts

Re: Exposing a web service with Cloudflare Tunnel

#15
If you have $3-5/month to spare on a VPS, a similar but self hosted solution can be achieved- Tunnel/VPN and reverse proxy- using Wireguard and Caddy.

Caddy in particular is extremely easy to configure, with the bonus that HTTPS/Lets Encrypt has never been free'er. Wireguard configuration is also gloriously minimal but admittedly, potentially tricky to get right the first time.

It's just good to consider alternatives to Cloudfare's network dominance, if you can afford it.

Re: Exposing a web service with Cloudflare Tunnel

#16
post #15

If you have $3-5/month to spare on a VPS, a similar but self hosted solution can be achieved- Tunnel/VPN and reverse proxy- using Wireguard and Caddy. Caddy in particular is extremely easy to configure, with the bonus that HTTPS/Lets Encrypt has never been free'er. Wireguard configuration is also gloriously minimal but admittedly, potentially tricky to get right the first time. It's just good to consider alternatives…

I've just done the same thing at work. I've got a little Dell Optiplex running bookstack here, and a AWS Graviton2 box running a wireguard server and reverse proxying web traffic over it.

Re: Exposing a web service with Cloudflare Tunnel

#17

I would rather use ngrok for these things: https://ngrok.com/ The reason why is because Alan is awesome.

out of interest - why? They seem to be targeted at different use cases - ngrok for dev work (looking at pricing and the limits on the free tier), and argo tunnels for permanent services

Re: Exposing a web service with Cloudflare Tunnel

#18
It's not obvious to me from the blogpost where TLS termination happens in this scenario.

I would want it to happen on my local machine, so that (a) Cloudflare can't read my plaintext traffic, and (b) I can manage subdomain certificates more easily via Caddy.

Is that possible with the cheapo free tunnels or does Cloudflare want to handle the domain and TLS certificates, too?

Re: Exposing a web service with Cloudflare Tunnel

#19

This looks pretty interesting to me. Self-hosting a webapp origin server on hardware in my house, fronted by CloudFlare... hmm. Food for thought.

One of the limitations that wasn't immediately obvious to me is that you're mapping a single domain with these tunnels. So you cannot easily make *.example.com available via a cloudflare tunnel. (and when I tried it it wasn't possible with ngrok either, perhaps that changed)

I ended up switching to a business connection with my ISP, so I could get an extra fixed IPv4 address at my house and not need any of these tunnels. Obviously that is not an option everywhere.

Post reply on HN