Repolode
tuanngocptn

tuanngocptn/nport

A free, open-source ngrok alternative that exposes localhost over HTTPS through Cloudflare Tunnels, with custom subdomains and no account required.

Open-source alternative to:ngrok

Stars
768
Forks
143
Open issues
0
Last commit
2 months ago

What is it?

NPort is a command-line tool that creates a public HTTP/HTTPS URL for a service running on your machine. You run a single command with a local port, such as nport 3000, and it returns a URL on nport.link that forwards traffic to localhost through Cloudflare's edge network.

Each tunnel can use a custom subdomain via the -s flag, and the tool needs no signup or account. It supports WebSocket and Server-Sent Events, and it creates the DNS record and tunnel on start and removes them when the process exits. Tunnels also expire automatically after four hours.

The default backend is hosted by the project. Users can point the CLI at their own backend through a flag, an environment variable, or a saved config file, and the project includes a server directory for self-hosting on Cloudflare Workers. The CLI is written in TypeScript and installs from npm, with a UI available in English, Vietnamese, and Spanish.

Key features

  • 01Creates HTTPS tunnels from localhost to public URLs via Cloudflare.
  • 02Supports custom subdomains with a single flag.
  • 03Requires no account or upfront configuration.
  • 04Supports WebSocket and Server-Sent Events traffic.
  • 05Can be pointed at a self-hosted backend.
  • 06Runs on Windows, macOS, and Linux.

Use cases

  • Sharing a local development server with teammates or clients.
  • Receiving webhooks from GitHub or Stripe on a local machine.
  • Testing a web app on a phone over a public HTTPS URL.
  • Debugging API integrations that need a reachable callback address.

Quick start

  1. 1

    Install NPort globally via npm

    npm install -g nport
  2. 2

    Start your local server (example for Next.js)

    npm run dev
  3. 3

    Expose port 3000 with a custom subdomain

    nport 3000 -s myapp

Things to know

  • The shared default backend is currently rate limited by Cloudflare's API quota, so tunnels may fail at times.
  • Tunnels automatically close after 4 hours.
  • Requires Node.js 20 or newer and npm 10 or newer.

Topics

FAQ

What is nport?
A free, open-source ngrok alternative that exposes localhost over HTTPS through Cloudflare Tunnels, with custom subdomains and no account required. NPort is a command-line tool that creates a public HTTP/HTTPS URL for a service running on your machine. You run a single command with a local port, such as nport 3000, and it returns a URL on nport.link that forwards traffic to localhost through Cloudflare's edge network.
Is nport free to use? What license does it have?
nport is open source under the MIT license. Check the license terms before using it in commercial products.
Is nport still maintained?
Updated within 6 months. The last commit to nport was on Aug 12, 2026.
What can I use nport for?
Sharing a local development server with teammates or clients. Receiving webhooks from GitHub or Stripe on a local machine. Testing a web app on a phone over a public HTTPS URL. Debugging API integrations that need a reachable callback address.
How do I install nport?
Install NPort globally via npm: npm install -g nport Start your local server (example for Next.js): npm run dev Expose port 3000 with a custom subdomain: nport 3000 -s myapp
Where can I get nport?
The source code and installation instructions are on GitHub: https://github.com/tuanngocptn/nport

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects