The Problem
Ever tried to show a local server to someone on the internet? You know, without the hassle of deploying it somewhere or jumping through hoops? Enter the frustration of needing a public URL for demos or testing webhooks. You want something quick, easy, and with zero config files. That’s where wormhole comes in.
What This Does
wormhole is an open-source alternative to ngrok that lets you expose your localhost to the internet with a single command. You just run wormhole http 3000, and voila! You've got a public HTTPS URL, thanks to Cloudflare handling the TLS magic. Check out the cmd/wormhole/main.go file if you want to see the entry point where this all kicks off.
The internal/client directory is where the real action happens. For example, local.go manages the local server traffic, while ws_passthrough.go ensures WebSocket connections work smoothly. It's all about making your life easier, and it does a decent job at that.
Real-World Use
Imagine you're working on a webhook for a payment processor like Stripe. You fire up your local server on port 3000 and run:
Now, you can provide the forwarding URL (like https://k7x9m2.wormhole.bar) to your team for testing. The built-in traffic inspector, accessible at http://localhost:4040, gives you live feedback on incoming requests and even lets you replay them with a click. Perfect for debugging!
Need a custom subdomain? Just run wormhole http 3000 --subdomain myapp after logging in with GitHub. Now, your URL looks a lot more professional.
The Bottom Line
wormhole is solid for developers who need to share local servers without the fuss of deployments. The features like request replay and traffic inspection are handy, but if you're working on small projects that don’t need real-time testing, this might feel like overkill. Still, for anyone juggling multiple local servers or integrating with webhooks, it's worth a shot.