The Problem

You're running a local dev server, and you need to share it with others, test webhooks, or debug APIs. Sure, you could use ngrok or one of its clones, but most of them are either rate-limited, paid, or run on someone else's infrastructure. If you're already paying for a VPS, why rely on third-party services when you could just roll your own?

What This Does

pgrok is like ngrok, except the infrastructure is yours. It uses SSH reverse tunnels and Caddy to expose local ports to the internet with automatic HTTPS. No weird proprietary protocols, no hidden servers—just good old SSH and a bit of clever scripting.

The server directory sets up your VPS. setup-vps.sh installs Caddy and some lightweight Python scripts (pgrok-ask and pgrok-tunnel) to dynamically manage routes and SSL certs. Meanwhile, the client directory, specifically the tui folder, gives you a slick terminal UI to monitor tunnels, inspect HTTP requests, and track connection stats in real-time. It's built on OpenTUI, and files like src/ui/connections.ts and src/ui/requests.ts handle the visuals like request logs and connection details.

Real-World Use

Say you're building a webhook for Stripe. You need a public HTTPS endpoint for testing, but you're sick of spinning up new ngrok instances every time. With pgrok, you'd just: Install the client (setup.sh makes this ridiculously easy). Run pgrok stripe 3000. Get a custom HTTPS URL (e.g., https://stripe.yourdomain.com) that forwards traffic to your local localhost:3000.

The TUI dashboard shows live traffic in color-coded logs. Spot the 400 errors immediately, debug your handler, and call it a day. No subscription fees, no random subdomains, no BS.

The Bottom Line

pgrok is perfect if you’ve got a VPS gathering dust and want a no-nonsense, self-hosted tunnel solution. The TUI is a nice touch, and the setup script is straightforward. The trade-off? You’re in charge of maintenance—if your VPS goes down, so do your tunnels. If you're the type who doesn't mind a bit of DIY for full control, this is a solid tool. If not, stick with ngrok.