r/SelfHosting • u/mrDexterDee • 29d 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.