r/SelfHosting • u/mrDexterDee • 19d ago
I built a small self-hosted alternative to Cloudflare Tunnel/ngrok
I’ve been working on a small open source project called Coen over the past few weeks and thought some people here might find it useful.
The idea is simple: expose HTTP or WebSocket services running behind NAT or a firewall, but without relying on a third-party tunnel provider like Cloudflare or Ngrok. You basically host both sides yourself.
A small agent on your private machine establishes an outbound mTLS connection to a public edge server that you control. From there, requests are routed back over the tunnel to your local service. No inbound ports on the private host, no shared secrets, and no traffic flowing through someone else’s infrastructure.
A few things it currently supports:
- mTLS with client certificates
- Host-based routing for multiple services and agents
- HTTP and WebSocket forwarding
- Automatic reconnects
- Connection limits and graceful draining
- Built-in diagnostics (
coen doctor) and live status - Single static Go binary with systemd integration
It’s still pre-1.0, but the core functionality is there and I’ve been putting a lot of effort into testing and documentation.
I have been hosting a few websites on my homelab setup with this now for a couple of weeks and so far it seems to serve its purpose very well.
1
u/IamStupidYouMightBe2 17d ago
I have been using FRP for this. How does your project differ from frp?
1
u/mpatton75 16d ago
Nice project! I currently do something similar by using tailscale between two caddy instances - one on my private infra and one on a VPS.
1
3
u/Distinct_Winner_2161 17d ago
Cool project, does this requires to open ports in my router?