Towonel: Open Source drop-in Cloudflare Tunnel alternative
(erwanleboucher.dev)
from fhoekstra@feddit.nl to selfhosted@lemmy.world on 21 May 10:33
https://feddit.nl/post/56825643
from fhoekstra@feddit.nl to selfhosted@lemmy.world on 21 May 10:33
https://feddit.nl/post/56825643
So you don’t want to port-forward on your home router or have Cloudflare decrypt all your traffic? Check out Towonel.
Most open source Cloudflare Tunnel alternatives involve setting up a VPS, terminating TLS there on a reverse proxy, then setting up a Wireguard tunnel to your server at home.
Towonel is different: it does not decrypt your traffic on the VPS and you can easily share one, so not every self-hoster has to buy and maintain a VPS.
Check it out!
Mastodon link: gts.erwanleboucher.dev/…/01KS4YNA2SYMSP0FSKJVNJA1…
threaded - newest
Very cool. I personally use a double wireguard network: a wireguard vpn at home for all my services, and then since my home network is behind a double NAT and impossible to access publicly, I use a second wireguard tunnel to a VPS, to forward traffic to my internal wireguard network. The only thing the VPS can see is encrypted wireguard packets.
Edit: it seems like this service is more for public or shared services (like a public blog), rather than private personal services, so wireguard is less of an option
Oh, nice find. I’m saving that
Oh great. So now there’s a tuwunel and a towonel and they’re completely different things.
(tuwunel is a fork of the matrix backend conduwuit. not to be confused with continuwuity, another conduwuit fork)
I know, the naming isn’t ideal.
On the bright side, you can now expose multiple tuwunel instances via a single towonel and federate with other tuwunels on other towonels for maximum
uwu owoWhich is almost what my friends and I are doing, except we’re running continuwuity instead of tuwunel.
<img alt="1000137440" src="https://infosec.pub/pictrs/image/1b610c06-152a-481c-ac07-8a365169249f.jpeg">
Holy shit. That’s all I got
<img alt="" src="https://lemmy.world/pictrs/image/3db7dd08-ebfa-40c2-8141-e9ac57b3991a.jpeg">
Huh, I wasn’t aware there were Conduit forks, thanks!
Oh right, forgot to mention conduwuit was itself a fork of conduit. Man
Uh. Blog is down. All I get is an 404 for the link in the Mastodon post.
Edit: Here’s a link that works: https://github.com/eleboucher/towonel
or web.archive.org/web/20260521095433/…/towonel/
edit: it’s back up
This bit makes me a little wary.
Why? I didn’t know python until one of my clients decided they would only use it for everything going forward. It took me all of a day to start converting C# code and this was a decade before LLMs.
Knowledge of a specific language does not reflect development skill.
Yes, but ported C# usually doesn’t make for the most idiomatic Python.
99% of the time that doesn’t matter, but a highly security sensitive reverse proxy shared by multiple users most likely part of the stack to be attacked might be an exception.
I like how you just assumed that what I was doing wasn’t security oriented…
Do most people running a vps reverse proxy terminate tls on the vps? I just proxy TCP 1:1 without touching it to my homelab over my wireguard tunnel. That seems easier than coordinating between the vps which services I’m running locally.
Do you have a link to a tutorial or an example setup for that? I’ve wanted that exact setup but couldn’t find how to do it.
Not really haha, you could say I followed a tutorial for setting up a wireguard server on a VPS, and then once I had the wireguard container running and my homelab boxes as clients, I started up an haproxy container on the VPS with
network_mode: “service:wireguard”so that the wireguard container can also see my homelab boxes through the tunnel, then also added ports 80 and 443 to the wireguard container on the VPS (in addition to the 51820 for incoming wireguard connections) - that has to be on the wireguard container because using network_mode means the haproxy container piggy backs on the wireguard container’s network, then I added a simple haproxy config that listens on 80/443 on the VPSes public IP and proxies it to the appropriate box on the other side of the tunnel.For the wireguard config, the key seems to be using
mode tcpin any backend or frontend that’s connected to port 443, so that it just proxies raw data without doing termination. With SNI, you can even proxy to different wireguard clients based on domain, because SNI exposes the domain without needing to do termination. So I do that because I have my NAS as well as a NUC connected to the wireguard network hosting different things.This is a stripped down version of my haproxy config:
global maxconn 20000 log 127.0.0.1 local0 daemon defaults mode http timeout connect 10s timeout client 1m timeout server 1m maxconn 8000 option tcpka option tcp-smart-connect default-server init-addr last,libc,none resolvers docker parse-resolv-conf frontend ingress_http bind :::80 bind :80 acl h_secondbox_http hdr(host) -i second.box.example.com use_backend secondbox_http if h_secondbox_http default_backend vault_http frontend ingress_https mode tcp bind :::443 bind :443 tcp-request inspect-delay 5s tcp-request content accept if { req_ssl_hello_type 1 } acl h_secondbox_https req_ssl_sni -i second.box.example.com use_backend secondbox_https if h_secondbox_https default_backend vault_https backend vault_http server vault_server_http 10.13.13.2:80 send-proxy-v2 backend vault_https mode tcp server vault_server_https 10.13.13.2:443 send-proxy-v2 backend secondbox_http server secondbox_server_http 10.13.13.3:80 send-proxy-v2 backend secondbox_https mode tcp server secondbox_server_https 10.13.13.3:443 send-proxy-v2The way this is set up, I do have to manually enter every subdomain I want to go to my second box, but the default is to route to my main vault, which is where I host most stuff anyways.
My docker compose on the VPS is pretty simple:
services: wireguard: image: linuxserver/wireguard:latest container_name: wireguard restart: unless-stopped cap_add:Not exactly a tutorial, but I use SNI routing + TLS passthrough with Caddy-L4 (and previously Traefik), and wrote/collect some stuff about it over the years:
theorangeone.net/…/wireguard-haproxy-gateway/. From TheOrangeOne, involves TCP routing with HAProxy and plain WireGuard. Most likely what you want.
muoi.me/~stratself/articles/tailscale-notes/#the-…. Me using Traefik + Tailscale to route TCP to the backend
jdedev.org/projects/tophomelabwork/…/traefik/. Another Traefik example
muoi.me/…/the-cost-of-tls-passthrough/#scenario-1…. Same but for Caddy-L4 and involves SNI routing. If you want plain TCP routing just do
{ layer4 { tcp/:443 { tcp/127.0.0.1:538 } } }Isn’t this similar to rathole or frp?
Very similar.
The main differences are that those projects are highly configurable and can do a lot of things, while towonel is simpler: opinionated/streamlined for use as a shared Cloudflare tunnel alternative. I also think towonel may be the only one to use QUIC for the tunnel, just like Cloudflare.
Besides that, towonel is very new and still in alpha. Rathole does not seem to be actively developed anymore, which can be a good or bad thing.
Is the agent only available as a docker image? I quite like the option to run Cloudflare tunnels as a local service (e.g. in LXCs).
Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I’ve seen in this thread:
[Thread #304 for this comm, first seen 21st May 2026, 13:30] [FAQ] [Full list] [Contact] [Source code]
It’s interesting OP. I use the evil Cloudflare Tunnels/Zero Trust, and I’m pretty much sold on it, much to the chagrin of others here. Yes, there are caveats, pros and cons. Even tho I am sold on the product, I would entertain a clone/fork/rewrite if it gave me everything that Cloudflare Tunnels/Zero Trust along with the security features. I’ll do some reading once the blog is back up.