README
ΒΆ
MKTL - Make Tunnel
MKTL (Make Tunnel) is a lightweight command-line tool that creates public tunnels to your local servers using various tunneling providers. It automatically downloads and manages the required binaries, making it easy to expose your local development servers to the internet.
Features
- π Multiple Providers: Supports ngrok, Cloudflare Tunnel (cloudflared), localtunnel, and Pinggy
- π§ Auto-Download: Automatically downloads the required binary for your platform
- π¨ Colorful Output: Beautiful colored terminal output with clear status indicators
- π¦ Single Binary: No dependencies - just download and run
- π No Account Required: Most providers work without registration (cloudflared, localtunnel, pinggy)
Supported Providers
| Provider | Status | Account Required | Notes |
|---|---|---|---|
| cloudflared | β Stable | β No | Fast, reliable, no setup needed |
| localtunnel | β Stable | β No | Requires Node.js/npx |
| pinggy | β Stable | β No | 60-minute free tier limit |
| ngrok | β Stable | β Yes | Requires authtoken setup |
Installation
Option 1: Download Binary (Recommended)
Download the pre-built binary for your platform from Releases
Windows:
mktl.exe -tool cloudflared -port 3000
Linux/macOS:
./mktl -tool cloudflared -port 3000
Option 2: Install via Go
go install github.com/batmanpriv/mktl@latest
Make sure your $GOPATH/bin is in your PATH.
Option 3: Build from Source
git clone https://github.com/batmanpriv/mktl.git
cd mktl
go build -o mktl .
Quick Start
1. Start a Local Server
First, make sure you have a server running locally. For testing, you can use Python:
# Python 3
python -m http.server 3000
# Node.js
npx serve -l 3000
# PHP
php -S localhost:3000
2. Create a Tunnel
Using cloudflared (Recommended - No Account):
mktl -tool cloudflared -port 3000
Using localtunnel (Requires Node.js):
mktl -tool localtunnel -port 3000
Using pinggy (60-minute limit):
mktl -tool pinggy -port 3000
Using ngrok (Requires authtoken setup):
mktl -tool ngrok -port 3000
3. Share Your Link
After running the command, you'll see output like:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
[~] MKTL - Tunnel Created Successfully
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
[>] https://your-tunnel-url.trycloudflare.com
[*] Press Ctrl+C to stop.
Share the URL with anyone to access your local server from anywhere.
Usage
Basic Usage
mktl -tool <provider> -port <port>
Command Line Options
| Flag | Description | Default |
|---|---|---|
-tool |
Tunneling provider: ngrok, cloudflared, localtunnel, pinggy |
ngrok |
-port |
Local port your server is running on | 8080 |
-list |
List all available providers and exit | false |
Examples
List available providers:
mktl -list
Create tunnel on port 3000 with cloudflared:
mktl -tool cloudflared -port 3000
Create tunnel on port 8080 with localtunnel:
mktl -tool localtunnel -port 8080
Create tunnel on port 5000 with pinggy:
mktl -tool pinggy -port 5000
Provider Setup Notes
Ngrok Setup
Ngrok requires authentication. You need to set up your authtoken:
- Create a free account at ngrok.com
- Get your authtoken from the dashboard
- Run once (the binary will be downloaded automatically):
ngrok config add-authtoken <YOUR_TOKEN>
cloudflared
No setup required. The tool will automatically download the latest cloudflared binary for your platform.
localtunnel
Requires Node.js and npx to be installed on your system:
node --version # Check if Node.js is installed
npx --version # Check if npx is available
pinggy
Uses your system's SSH client. No additional setup required.
- Windows 10+: OpenSSH is usually pre-installed
- Linux/macOS: SSH is typically available by default
- Termux:
pkg install openssh
How It Works
- Platform Detection: Detects your OS (Windows, Linux, macOS) and architecture
- Binary Management: Downloads the appropriate binary for your platform
- Tunnel Creation: Launches the tunnel with the specified port
- URL Extraction: Parses the output to extract the public URL
- Display: Shows the public URL in a clear, formatted way
Troubleshooting
Port Not Listening Warning
[!] Nothing seems to be listening on localhost:3000 yet
Make sure your local server is running before creating the tunnel.
cloudflared Returns api.trycloudflare.com
If you see api.trycloudflare.com instead of a real tunnel URL:
- Disable VPN and try again
- Try a different network
- Wait a few minutes and retry
- Switch to a different provider
Timeout Errors
If you get timed out waiting for provider to report a public URL:
- Check your internet connection
- Some providers may be temporarily unavailable
- Try a different provider
ngrok Authentication Error
If ngrok fails, make sure you've set up your authtoken:
ngrok config add-authtoken <YOUR_TOKEN>
File Structure
After first use, binaries are cached in:
- Windows:
%USERPROFILE%\.mktl\ - Linux/macOS:
~/.mktl/
Development
Requirements
- Go 1.21 or higher
Building
go build -o mktl .
Testing
go test ./...
Documentation
ΒΆ
There is no documentation for this package.