rustunnel vs ngrok — Pricing, Architecture, and Why We Built an Alternative
A side-by-side comparison of tunneling services: pricing models, self-hosting, architecture, and performance. Includes a billing infographic and a technical diagram of how rustunnel works under the hood.
ngrok has been the default tool for exposing local servers to the internet for over a decade. If you've ever tested a Stripe webhook, debugged an OAuth flow, or shared a work-in-progress with a client, you've probably used it.
But the tunneling space has changed. Pricing structures feel increasingly misaligned with how developers actually work. Vendor lock-in is a growing concern. And the demand for self-hosted, open-source alternatives has never been higher.
That's why we built rustunnel. Here's how the two compare — not just on features, but on the economics and architecture behind them.
Pricing: Flat Fee vs Pay-as-you-go
The biggest difference isn't a feature — it's the billing model.
ngrok charges a fixed monthly fee per plan tier. You pay the same amount whether your tunnels are actively proxying traffic or sitting idle over the weekend. rustunnel meters the only thing that has a real infrastructure cost: bandwidth.
The math is straightforward. With ngrok's $8/month Personal plan, you're paying $96/year regardless of how much you actually use the tunnels. With rustunnel, a developer who proxies 20 GB in a month pays $3 — because 20 GB falls within the 30 GB floor. Proxy 50 GB, and the bill is $5.
max($3, actual_usage × $0.10)— that's the entire pricing formula. No per-request charges, no per-tunnel fees, no games.
Feature Comparison
| rustunnel | ngrok | |
|---|---|---|
| Pricing | $0 / $3+pay-as-you-go / Free self-host | $0 (limited) / $8 / $20 / $35+ |
| Billing model | Metered bandwidth | Flat monthly per plan |
| Self-hosting | Yes, free forever (AGPL) | Enterprise plan only |
| Open source | Yes | No |
| Custom subdomains | Yes (PAYG & self-host) | Yes ($20+/mo plans) |
| Custom domains | Yes (self-host, your DNS) | Yes ($20+/mo plans) |
| TLS termination | Automatic (Let's Encrypt) | Automatic |
| HTTP + TCP tunnels | Yes | Yes |
| WebSocket support | Yes | Yes |
| Spend cap | Yes | No |
| Multi-region | Yes (eu, us, ap) | Yes |
| Client binary | ~5 MB (Rust) | ~25 MB (Go) |
How rustunnel Works
rustunnel's architecture is intentionally simple. A lightweight client on your machine establishes a WebSocket connection to a relay server. That single multiplexed connection carries all your tunnel traffic — HTTP requests, TCP streams, WebSocket upgrades — through one persistent pipe.
Here's what's happening at each step:
-
Client connects — the
rustunnelbinary on your machine opens a WebSocket (WSS) connection to the nearest edge relay. This is a single outbound connection on port 443, so it works through NATs and firewalls without any configuration. -
Tunnel registration — the client sends a registration frame with a
tunnel_id, the protocol (HTTP or TCP), and the local port. The relay stores this mapping. -
TLS termination — when a request hits
https://your-subdomain.edge.rustunnel.com, the relay terminates TLS. Your local server never needs HTTPS — it can serve plain HTTP on localhost. -
Multiplexed proxying — the relay wraps the incoming request in a WebSocket frame tagged with the correct
tunnel_idand sends it down the shared connection. The client demuxes it and forwards tolocalhost:PORT. The response travels back the same way. -
Automatic reconnect — if the connection drops, the client reconnects with exponential backoff (1s → 2s → 4s → ... → 60s max) with random jitter to prevent thundering-herd reconnections.
The key architectural decision is multiplexing. Instead of opening a new TCP connection per tunnel, rustunnel shares a single WebSocket across all tunnels. This means running 10 tunnels has the same connection overhead as running 1.
Self-Hosting: Full Control or Zero Hassle
This is where the comparison gets interesting. ngrok reserves self-hosting for their Enterprise plan, which requires contacting sales. rustunnel makes self-hosting the default — the server is open-source under AGPL, and you can deploy it on any VPS with a single command.
curl -fsSL https://install.rustunnel.dev | sh
rustunnel-server init --domain tunnel.yourdomain.com
rustunnel-server start --tls --email admin@yourdomain.comThat's it. You're running your own tunnel infrastructure with automatic Let's Encrypt TLS. No monthly bills, no usage caps, no vendor dependency.
The managed service at rustunnel.com exists for developers who don't want to manage infrastructure — same client binary, same features, pay for bandwidth. But the self-hosted path is always there, always free, always fully functional.
The practical difference: If your company requires data sovereignty (healthcare, finance, government), or you need custom branding on tunnel URLs, or you want to avoid recurring SaaS charges entirely — self-hosted rustunnel is the only option that gives you all of this without an Enterprise contract.
Performance: Rust vs Go
Both tools are built on modern compiled languages, but the runtime characteristics differ.
| Metric | rustunnel (Rust) | ngrok (Go) |
|---|---|---|
| Client binary size | ~5 MB | ~25 MB |
| Memory usage | ~8 MB (idle) | ~30 MB (idle) |
| Connection setup | 1 TCP round-trip | 1 TCP round-trip |
| Concurrency model | Tokio async (epoll/io_uring) | Go goroutines |
| Multiplexing | WebSocket streams | HTTP/2 or WebSocket |
In practice, both are fast enough for development tunneling. The difference shows up at scale — rustunnel's lower memory footprint means you can run more tunnels per relay server, and Rust's zero-cost abstractions mean there's less GC pressure under sustained load.
When to Stick with ngrok
rustunnel isn't the right choice for everyone. If you're a solo developer who occasionally needs a quick tunnel for an hour and doesn't want to think about infrastructure, ngrok's free tier or $8 Personal plan is convenient. The managed experience is polished — no server setup, no DNS configuration, no monitoring to worry about.
But if any of these apply to you, rustunnel is worth a serious look:
- You're paying $20+/month for tunnel features you don't always use
- You need self-hosting for compliance or data sovereignty
- You want predictable, usage-based billing instead of flat fees
- You're running tunnels in CI/CD pipelines where costs can spike unpredictably
- You want the option to self-host without losing access to a managed service
Getting Started
Install rustunnel and create your first tunnel in under a minute:
brew tap joaoh82/rustunnel
brew install rustunnel
rustunnel setup
rustunnel http 3000The Hobby plan is free (2 tunnels, random subdomains). The pay-as-you-go plan starts at $3/month. Or deploy the self-hosted server on your own infrastructure — it's free forever.
# Self-host on any VPS
curl -fsSL https://install.rustunnel.dev | sh
rustunnel-server init --domain tunnel.yourdomain.com
rustunnel-server start --tls --email admin@yourdomain.comCheck out the documentation for the full setup guide, or explore the source code on GitHub.