share-web-cli
v1.0.0
Published
Easy CLI tool to share local web services using ngrok without DNS/firewall configuration
Maintainers
Readme
Share Web CLI
A simple and powerful CLI tool to easily share your local web services to the internet using ngrok without complex DNS and firewall configuration.
Features
- 🚀 Easy Tunneling: Start sharing web services with a single command
- 🔧 Multiple Protocols: Support for HTTP, HTTPS, and TCP tunnels
- 📊 Status Monitoring: Check tunnel status and get access URLs
- ⚙️ Configuration Management: Easy ngrok configuration editing
- 🎯 Developer Friendly: Common development ports predefined
- 🛡️ No DNS Required: Perfect for development and testing
Installation
Via npm (Recommended)
npm install -g share-web-cliFrom Source
- Clone this repository
- Install dependencies:
npm installUsage
Basic Usage
# Share a service running on port 3000
share-web start 3000
# Share a service on port 8080
share-web start 8080
# Check current tunnel status
share-web status
# Stop all tunnels
share-web stopAdvanced Usage
# Share with specific protocol
share-web start 3000 --protocol https
# Share TCP service (e.g., database)
share-web start 5432 --protocol tcp
# List common development ports
share-web list
# Show current configuration
share-web config show
# Edit configuration
share-web config editCommands
start [PORT]
Start ngrok tunnel for specified port (default: 3000)
Options:
--protocol: Protocol to use (http, https, tcp)- Default protocol: http
Examples:
share-web start 8080
share-web start 3000 --protocol https
share-web start 22 --protocol tcpstop
Stop all active ngrok tunnels
Example:
share-web stopstatus
Show current tunnel status and access URLs
Example:
share-web statuslist
List common development ports and their typical uses
Example:
share-web listconfig
Manage ngrok configuration
Subcommands:
show: Display current configurationedit: Open configuration file in your default editor
Examples:
share-web config show
share-web config editCommon Development Ports
| Port | Typical Use | |------|-------------| | 3000 | Next.js, React development server | | 8080 | Generic web application | | 5000 | Flask, Django development | | 3001 | Alternative React port | | 8000 | FastAPI, Pyramid development | | 4200 | Angular development server | | 5432 | PostgreSQL database | | 6379 | Redis cache | | 27017 | MongoDB database |
How It Works
Share Web CLI uses ngrok to create secure tunnels to your local development servers. When you start a tunnel:
- ngrok creates a secure connection to the ngrok cloud
- Your local port is exposed through a public URL
- You receive a public URL that can be shared with others
- All traffic is routed through the encrypted tunnel
Requirements
- Python 3.6 or higher
- ngrok binary (automatically downloaded)
- npm (for installation)
Troubleshooting
Port Already in Use
If you get a "port already in use" error:
# Check what's using the port
lsof -i :3000
# Kill the process if needed
kill -9 <PID>ngrok Not Found
If you get an ngrok error, make sure ngrok is properly installed:
# Download ngrok manually
wget https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-amd64.tgz
tar -xzf ngrok-v3-stable-linux-amd64.tgz
chmod +x ngrokAuthentication Issues
For persistent ngrok tunnels, you may need to:
- Sign up for a free ngrok account
- Get your auth token from https://dashboard.ngrok.com/
- Configure it in the ngrok configuration file
Examples
Development Workflow
- Start your development server:
# React app
npm start
# Next.js app
npm run dev
# Flask app
python app.py- In another terminal, start the tunnel:
share-web start 3000- Share the generated public URL with collaborators or for testing webhooks
Testing Webhooks
# Start your webhook receiver
python webhook_server.py # running on port 5000
# Create tunnel for webhook testing
share-web start 5000
# Use the public URL in your webhook provider settingsDatabase Access
# Start PostgreSQL locally (usually port 5432)
pg_ctl start
# Share database access
share-web start 5432 --protocol tcp
# Others can connect using the provided TCP URLContributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the ISC License - see the LICENSE file for details.
Acknowledgments
- ngrok for providing the tunneling service
- The open-source community for inspiration and feedback
Support
If you encounter any issues or have questions:
- Check the troubleshooting section
- Search existing issues
- Create a new issue with detailed information about your problem
Made with ❤️ by MiniMax Agent
