Skip to content
Β 
Β 

Latest commit

Β 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

NPort

πŸš€ Free & open source ngrok alternative - Tunnel localhost to the internet via Cloudflare Edge

GitHub NPM Website License

What is NPort?

nport

NPort is a powerful, lightweight ngrok alternative that creates secure HTTP/HTTPS tunnels from your localhost to public URLs using Cloudflare's global edge network. No configuration, no accounts, just instant tunnels with custom subdomains!

Perfect for:

  • πŸš€ Development environments - Share your local work instantly
  • πŸ”’ Testing webhooks - Receive webhooks from GitHub, Stripe, PayPal, etc.
  • πŸ“± Mobile testing - Test your web app on real devices
  • πŸ› οΈ API development - Debug integrations with external services
  • πŸ‘₯ Demo to clients - Show your progress without deployment

✨ Features

  • ⚑ Instant Setup: One command to expose your localhost
  • 🌐 Custom Subdomains: Choose your own URL (e.g., myapp.nport.link)
  • πŸ”’ Automatic HTTPS: SSL/TLS encryption via Cloudflare
  • 🌍 Global Edge Network: Fast connections worldwide via Cloudflare
  • πŸ“‘ WebSocket Support: Full WebSocket and Server-Sent Events support
  • 🎯 No Configuration: Works out of the box
  • πŸ’» Cross-Platform: Windows, macOS, and Linux support
  • πŸ†“ 100% Free: No accounts, no limits, no paywalls
  • πŸ”“ Open Source: MIT licensed

πŸ“¦ Installation

NPM (Recommended)

# Global installation
npm install -g nport

# Or use npx without installation
npx nport 3000 -s myapp

From GitHub

npm install -g git+https://github.com/tuanngocptn/nport.git

πŸš€ Quick Start

Basic Usage

Expose port 3000 with a random subdomain:

nport 3000

Output:

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  NPort - Free & Open Source ngrok Alternative
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  🌐 Website: https://nport.link
  πŸ“¦ NPM:     https://www.npmjs.com/package/nport
  πŸ’» GitHub:  https://github.com/tuanngocptn/nport
  β˜• Support: https://buymeacoffee.com/tuanngocptn
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

πŸš€ Starting Tunnel for port 3000...
βœ” Tunnel created!
🌍 Public URL: https://user-1234.nport.link

Custom Subdomain

Choose your own subdomain:

nport 3000 -s myapp
# Creates: https://myapp.nport.link

Or using long form:

nport 3000 --subdomain myapp

πŸ“– Usage Examples

Web Development

# Next.js
npm run dev
nport 3000 -s my-nextjs-app

# React (Create React App)
npm start
nport 3000 -s my-react-app

# Vue.js
npm run dev
nport 8080 -s my-vue-app

# Express.js
node server.js
nport 3000 -s my-api

Webhook Testing

# Start your local webhook receiver
node webhook-receiver.js

# Expose it to the internet
nport 4000 -s my-webhooks

# Use in GitHub webhook settings:
# https://my-webhooks.nport.link/webhook

Mobile Device Testing

# Start your local dev server
npm run dev

# Create tunnel
nport 3000 -s mobile-test

# Open on your phone:
# https://mobile-test.nport.link

🎯 CLI Options

nport <port> [options]
Option Short Description Example
<port> - Local port to tunnel (default: 8080) nport 3000
--subdomain -s Custom subdomain nport 3000 -s myapp
-s=value - Alternative format nport 3000 -s=myapp

πŸ”§ How It Works

  1. You run nport 3000 -s myapp
  2. NPort creates a Cloudflare Tunnel
  3. DNS record is created: myapp.nport.link β†’ Cloudflare Edge
  4. Cloudflared binary connects your localhost:3000 to Cloudflare
  5. Traffic flows through Cloudflare's global network to your machine
  6. On exit (Ctrl+C), tunnel and DNS are automatically cleaned up
Internet β†’ Cloudflare Edge β†’ Cloudflare Tunnel β†’ Your localhost:3000
         (https://myapp.nport.link)

πŸ›‘οΈ Security

  • HTTPS by default: All tunnels use SSL/TLS encryption
  • Cloudflare protection: DDoS protection and security features
  • Automatic cleanup: Tunnels are removed when you stop the process
  • No data logging: We don't store or log your traffic

πŸ†š Comparison with ngrok

Feature NPort ngrok
Price 100% Free Free tier limited
Custom subdomains βœ… Always ❌ Paid only
HTTPS βœ… Always βœ…
Account required ❌ No βœ… Yes
Time limits ❌ None ⚠️ Free tier limited
Open source βœ… MIT ❌ Proprietary
Global network βœ… Cloudflare βœ… ngrok Edge

🧹 Cleanup

NPort automatically cleans up resources when you:

  • Press Ctrl+C to exit
  • Kill the process
  • Terminal closes

The cleanup process:

  1. βœ… Deletes DNS record (myapp.nport.link)
  2. βœ… Removes Cloudflare Tunnel
  3. βœ… Stops cloudflared process

πŸ› Troubleshooting

Binary not found

If you see "Cloudflared binary not found":

npm install -g nport --force

Port already in use

Make sure your local server is running on the specified port:

# Check if something is listening on port 3000
lsof -i :3000  # macOS/Linux
netstat -ano | findstr :3000  # Windows

Subdomain already taken

Choose a different subdomain name:

nport 3000 -s myapp-v2

Connection issues

The ERR Cannot determine default origin certificate path warning is harmless and can be ignored. It appears because cloudflared checks for certificate-based authentication (we use token-based instead).

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ’– Support

If you find NPort useful, please consider supporting the project:

πŸ“„ License

MIT License - Feel free to use NPort in your projects!

πŸ™ Credits

πŸ”— Links


Made with ❀️ by Nick Pham

About

NPort is a powerful, lightweight ngrok alternative that creates secure HTTP/HTTPS tunnels from your localhost to public URLs using Cloudflare's global edge network. No configuration, no accounts, just instant tunnels with custom subdomains!

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages