
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
localhost-public
Advanced tools
Make your localhost publicly accessible with optional custom authentication through tunneling
Make your localhost publicly accessible with custom authentication
A simple, secure CLI tool that creates public tunnels to your local development server with built-in authentication support. Perfect for sharing your work, testing webhooks, or demonstrating applications without deploying. It is a wrapper of modern features around localtunnel package
# Install globally
npm install -g localhost-public
# Or use without installing
npx localhost-public
# Start your local server first
npm start OR npm run dev # or however you start your app
# Then in another terminal, create a public tunnel
localhost-public
That's it! Your localhost:3000 is now publicly accessible.
# Tunnel default port 3000
localhost-public
# Tunnel custom port
localhost-public --port 8080
# Custom expiry time
localhost-public --expiry 1h
# Enable authentication (auto-generated password)
localhost-public --auth
# Custom credentials
localhost-public --auth --username myuser --password mypass
# Custom auth port
localhost-public --auth --auth-port 4000
| Option | Short | Description | Default |
|---|---|---|---|
--port | -p | Local port to tunnel | 3000 |
--host | -h | Tunnel host service | https://loca.lt |
--expiry | -e | Tunnel expiry time (s/m/h) | 24h |
--auth | Enable authentication | false | |
--username | -u | Auth username | admin |
--password | -w | Auth password | auto-generated |
--auth-port | Auth server port | main port + 1000 |
30s - 30 seconds5m - 5 minutes2h - 2 hours24h - 24 hours (default)When authentication is enabled with --auth:
User visits tunnel URL → Login page (IP Address) → Login page (Custom) → Enter credentials → Access your app
localhost-public --auth --port 3000 --expiry 2h
Output:
🌐 Localhost Public Tunnel
Authentication enabled
Press Ctrl+C to stop the tunnel
Creating authenticated tunnel for localhost:5173...
📱 Detected app type: react
Authentication server running on port 6173
Authenticated tunnel created successfully!
Public URL: https://odd-clocks-learn.loca.lt
Login Required: https://odd-clocks-learn.loca.lt/login
Local URL: http://localhost:5173
Auth Server: http://localhost:6173
Default Credentials:
Username: admin
Password: d5c9fc1bbb152ffc
📱 QR Code for mobile access:
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█ ▄▄▄▄▄ █ ▀▄▄▄▀▄ █ ▄▄▄▄▄ █
█ █ █ █ ▄▄ █▀▄█ █ █ █ █
█ █▄▄▄█ █▀▄▀▄█▀▄▄ █ █▄▄▄█ █
█▄▄▄▄▄▄▄█▄▀ █▄█ █ █▄▄▄▄▄▄▄█
█ ▄▀▀▄ ▄██▄ ▀▄█▀▀▀██▄▀ ▄ ▄█
██▄█▀ ▀▄██ ▀▄ █▄▄█▀█ ▄ ▀██
█▀▄ ██▀▄▀ ██ ▄▀▀ ▀▄▄▄▀▄▄ ▄█
███ ▄ ▄ ▄▄▄ ▀█ ▄▀█ ▄ ▀██
█▄▄███▄▄▄▀ ▀ ▄▀▀▄ ▄▄▄ ▄▄███
█ ▄▄▄▄▄ █▀█▄▄▀█▀█ █▄█ ▀▀▀██
█ █ █ █▄▄█ ▀█▀ ▄ ▄▄ █▄█
█ █▄▄▄█ █▀█▀▄▀▄█ ▄▄ ▀▀ ▀ ██
█▄▄▄▄▄▄▄█▄▄█▄▄██▄█▄▄███▄▄▄█
Testing tunnel connection...
Could not verify tunnel (but it might still work)
==================================================
AUTHENTICATION DETAILS
==================================================
Login Credentials:
Username: admin
Password: d5c9fc1bbb152ffc
Access Instructions:
1. Visit: https://odd-clocks-learn.loca.lt
2. You'll be redirected to login page
3. Enter above credentials
4. Access your application
Security Notes:
• Session expires in 24h
• Keep credentials secure
==================================================
PASSWORD WAS AUTO-GENERATED
Save it now - it won't be shown again!
Next time use: --password your-password
## Examples
### Development & Testing
```bash
# Quick demo for 30 minutes
localhost-public --expiry 30m
# Secure tunnel for client review
localhost-public --auth --username client --password demo123
# Webhook testing
localhost-public --port 8080 --expiry 2h
# React development server
npm start &
localhost-public --port 3000
# Express API server
node server.js &
localhost-public --port 8080 --auth
# Next.js development
npm run dev &
localhost-public --port 3000 --expiry 4h
The tool provides helpful error messages and solutions:
Error: Port 3000 is already in use
Tips:
• Check if port 3000 is already in use
• Try a different port: --port 3001
Error: No server detected on port 3000
Make sure your application is running:
• Start your app on port 3000
• Verify it's accessible at http://localhost:3000
# Clone the repository
git clone https://github.com/TanishValesha/localhost-public.git
cd localhost-public
# Install dependencies
npm install
# Link for local testing
npm link
# Test the CLI
localhost-public --help
If this project helped you, please consider:
Tanish Valesha
GitHub: @TanishValesha X (Twitter): @tanish_valesha LinkedIn: Tanish Valesha
FAQs
Make your localhost publicly accessible with optional custom authentication through tunneling
We found that localhost-public demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.