Tools: Stop paying for ngrok! 🛑 Meet NPort: The Free Open Source Alternative

Tools: Stop paying for ngrok! 🛑 Meet NPort: The Free Open Source Alternative

Source: Dev.to

The Problem 😫 ## What is NPort? 🚀 ## 🎥 See it in action ## How it compares ## How to use it 💻 ## 1. Install via NPM ## 2. Start your local server ## 3. Create a Tunnel ## 4. Done! 🎉 ## Under the Hood ⚙️ ## Privacy & Self-Hosting 🛡️ ## Give it a try! We've all been there. You are demoing a Next.js app to a client, or testing a Stripe webhook locally. You fire up ngrok, send the link, and 2 hours later... the session expires. Or worse, you restart your server, and the domain changes from random-xyz.ngrok-free.app to random-abc.ngrok-free.app. You have to go update your webhook settings again. To get a stable, custom subdomain, you usually have to pay. I got tired of this, so I decided to build my own solution using the massive edge network of Cloudflare. NPort is a Node.js CLI tool that exposes your localhost to the internet. It is 100% Free, Open Source, and designed to be a "set it and forget it" replacement for paid tunneling services. I recorded a quick demo showing how fast it is to get a live HTTPS link: You need Node.js installed. Let's say your Next.js or Express app is running on port 3000. (The -s flag stands for subdomain) You can now access your app at https://nickpham.nport.link. Here is what it looks like in the terminal: As you can see, the connection is established instantly, and you get a beautiful, clean summary of your session. For the curious technical folks, here is how NPort works: Because it runs on Cloudflare Workers, the infrastructure cost is near zero, which is why I can offer this for free to the community. Privacy is important. While NPort uses end-to-end encryption via Cloudflare, I understand that for sensitive projects, you might want full control. NPort is fully open-source. You can fork the repository and deploy your own "Backend" on your own Cloudflare account. I built this tool to help my own team, and I hope it helps you too. If you find it useful, please consider giving it a Star ⭐ on GitHub. It helps more developers find the tool! Happy Coding! 👩‍💻👨‍💻 Templates let you quickly answer FAQs or store snippets for re-use. Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink. Hide child comments as well For further actions, you may consider blocking this person and/or reporting abuse COMMAND_BLOCK: npm install -g nport Enter fullscreen mode Exit fullscreen mode COMMAND_BLOCK: npm install -g nport COMMAND_BLOCK: npm install -g nport CODE_BLOCK: nport 3000 -s nickpham Enter fullscreen mode Exit fullscreen mode CODE_BLOCK: nport 3000 -s nickpham CODE_BLOCK: nport 3000 -s nickpham - 💸 100% Free: No monthly fees. - 🔗 Free Custom Subdomains: You can claim my-project.nport.link for free. No more random strings. - ⚡ Fast: Powered by Cloudflare Tunnel (Argo), so it uses their global edge network. - 🔒 Secure: Automatic HTTPS. - 🛠 Self-Hostable: Don't trust my server? Fork the repo and deploy the backend to your own Cloudflare Workers account (Free tier) in 5 minutes. - Client: The CLI (Node.js) creates a secure tunnel connection using the Cloudflare Tunnel protocol. - Edge: The connection is routed through Cloudflare's nearest edge location. - Backend: I used Cloudflare Workers (serverless) to handle the routing and subdomain logic. This ensures high availability and low latency. - You get your own private tunnel server. - You can use your own domain name (e.g., tunnel.your-company.com). - Check the server/README.md in the repo for instructions. - Github Repo: github.com/tuanngocptn/nport - Website: nport.link