npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

mgrok-cli

v1.0.3

Published

Secure tunneling service for exposing local services to the internet

Readme

MGrok CLI - Secure Tunneling Service

MGrok CLI is a powerful and secure tunneling service that allows you to expose local services to the internet with ease. Perfect for development, testing, webhook integration, and remote access.

Installation

Global Installation (Recommended)

npm install -g mgrok-cli

Local Installation

npm install mgrok-cli

Quick Start

After installation, you can start using MGrok immediately:

# Login to your account
mgrok login

# Start a tunnel for a local web server
mgrok http 8080

# Start a tunnel with custom domain
mgrok http 8080 --url=custom.yourdomain.com

# Start a TCP tunnel for SSH
mgrok tcp 22

# Start a UDP tunnel for DNS
mgrok udp 53

Features

  • 🚀 Easy to Use - Simple command-line interface
  • 🔒 Secure - HTTPS tunnels with SSL certificates
  • 🌍 Global - Fast servers worldwide (Brazil region)
  • 📊 Real-time Monitoring - Web interface with connection logs
  • 🔧 Advanced Options - Remote host forwarding, custom domains
  • 💳 Free Tier Available - Generous free plan
  • 🎯 Subdomain Support - Use custom subdomains
  • 📱 Cross-Platform - Windows, macOS, Linux, FreeBSD
  • 🔄 Auto-reconnect - Automatic tunnel recovery
  • 📈 Request Logging - Real-time HTTP request tracking

Commands

Authentication

# Login to your MGrok account
mgrok login

# Logout from current account
mgrok logout

# Check login status
mgrok status

HTTP Tunnels

# Basic HTTP tunnel (localhost)
mgrok http 8080

# HTTP tunnel for remote host
mgrok http 80 192.168.1.100

# HTTP tunnel with custom domain
mgrok http 8080 --url=custom.yourdomain.com

# HTTP tunnel for remote host with custom domain
mgrok http 80 192.168.1.100 --url=remote.yourdomain.com

TCP Tunnels

# Basic TCP tunnel (localhost)
mgrok tcp 22

# TCP tunnel with subdomain
mgrok tcp 22 myapp.mgrok.app

# TCP tunnel for remote host
mgrok tcp 22 192.168.1.100

# TCP tunnel with custom domain
mgrok tcp 22 custom.domain.com

UDP Tunnels

# Basic UDP tunnel (localhost)
mgrok udp 53

# UDP tunnel with subdomain
mgrok udp 53 dns.mgrok.app

# UDP tunnel for remote host
mgrok udp 53 192.168.1.100

# UDP tunnel with custom domain
mgrok udp 53 custom.domain.com

Management

# List all active tunnels
mgrok list

# Check for updates
mgrok update

# Show help
mgrok --help

Usage Examples

Web Development

# Expose local development server
mgrok http 3000

# Result: https://random-subdomain.mgrok.app
# Web Interface: http://127.0.0.1:4000 (for monitoring)

Remote SSH Access

# Expose SSH server for remote access
mgrok tcp 22

# Result: tcp://random-subdomain.mgrok.app:port

Database Access

# Expose local database
mgrok tcp 5432

# Access remotely: psql -h random-subdomain.mgrok.app -p port -U username

Webhook Testing

# Test webhooks from external services
mgrok http 8080 --url=webhook.yourdomain.com

# External services can send webhooks to: https://webhook.yourdomain.com

Remote Device Access

# Access service on remote device in local network
mgrok http 80 192.168.1.50

# Access service on remote device via internet
mgrok tcp 22 device.mgrok.app

Web Interface

When you start an HTTP tunnel, MGrok automatically provides a web interface for monitoring:

  • URL: http://127.0.0.1:4000 (port varies based on local port)
  • Features:
    • Real-time connection monitoring
    • HTTP request logs with status codes
    • IP address tracking
    • User agent information
    • Connection statistics

Configuration

Config File Location

MGrok stores configuration in:

  • macOS: ~/Library/Application Support/mgrok/config.json
  • Linux: ~/.config/mgrok/config.json
  • Windows: %APPDATA%\mgrok\config.json

Environment Variables

  • MGROK_SERVER_URL - API server URL (default: https://api.mgrok.app)
  • MGROK_LOG_LEVEL - Log level (info, debug, error)

Advanced Features

Remote Host Forwarding

Forward traffic to a different host in your network:

# Forward to another machine in local network
mgrok http 80 192.168.1.100

# Forward to service in Docker container
mgrok http 8080 172.17.0.2

# Forward TCP service on remote host
mgrok tcp 3306 database.local

Custom Domains

Use your own domain with MGrok:

# Requires domain configuration in your MGrok account
mgrok http 8080 --url=api.yourdomain.com
mgrok tcp 22 --url=ssh.yourdomain.com

Subdomain Forwarding

Use MGrok subdomains for organized access:

# TCP tunnel with subdomain
mgrok tcp 22 myssh.mgrok.app

# UDP tunnel with subdomain
mgrok udp 53 dns.mgrok.app

Troubleshooting

Common Issues

  1. "You need to login first"

    mgrok login
  2. Port already in use

    • Check if the local port is available
    • Use a different local port number
  3. Connection refused

    • Verify your local service is running
    • Check if the port number is correct
    • Ensure firewall allows the connection
  4. Remote host not accessible

    • Verify network connectivity to remote host
    • Check if remote service is running
    • Ensure firewall allows remote access

Debug Mode

Enable verbose logging for troubleshooting:

# Check connection status
mgrok status

# Monitor web interface for request logs
# Access: http://127.0.0.1:4000

API Integration

MGrok CLI can be used programmatically:

const { spawn } = require('child_process');

// Start HTTP tunnel
const tunnel = spawn('mgrok', ['http', '8080']);

tunnel.stdout.on('data', (data) => {
  console.log(`Tunnel output: ${data}`);
});

// Stop tunnel
tunnel.kill('SIGINT');

Updates

MGrok CLI automatically checks for updates:

# Check for updates manually
mgrok update

# The CLI will notify you if updates are available
# Follow the instructions to upgrade

Security

  • 🔒 All HTTP tunnels use HTTPS by default
  • 🔑 Authentication required for tunnel creation
  • 🛡️ SSH key-based tunnel connections
  • 🔒 Encrypted communication between client and server
  • 📝 Request logging for security monitoring

Platform Support

MGrok CLI supports the following platforms:

  • Windows (x64, ARM64)
  • macOS (Intel, Apple Silicon)
  • Linux (x64, ARM64, ARM)
  • FreeBSD (x64)

Support

License

MIT License - see LICENSE file for details.


Version: 1.0.1
Region: Brazil (São Paulo)
Web Interface: Real-time monitoring and logging