UNPKG

lorpy

Version:

A simple CLI tool that creates a localtunnel with QR code sharing. Makes local development and remote access easy with instant QR code generation and secure tunnel access. Perfect for mobile testing, demos, and webhooks.

130 lines (95 loc) 3.23 kB
# Lorpy 🚀 A powerful CLI tool that makes sharing your local development server a breeze! Lorpy combines the power of localtunnel with instant QR code generation, making it perfect for: - 📱 Mobile app testing across devices - 🌐 Sharing your work with clients or team members - 🔄 Testing webhooks without deployment - 🎯 Quick demos of your local development - 🔒 Secure tunnel access with automatic password protection No more copying long URLs or dealing with complex setups - just run one command and scan the QR code! ## Installation ```sh npm install -g lorpy ``` Or use with npx: ```sh npx lorpy <port> ``` ## Usage ```sh lorpy <port> ``` - Starts a localtunnel on the given port - Prints the public URL - Shows a QR code for easy sharing - Keeps running until you stop it (Ctrl+C) ## Important: Accessing Your Tunnel When someone visits your tunnel URL, they'll need a password. Here's what you need to know: 1. **Getting the Tunnel Password:** - If running locally: Visit https://loca.lt/mytunnelpassword in your browser - If running on remote server: Run `curl https://loca.lt/mytunnelpassword` 2. **Share with Visitors:** - Share both the tunnel URL AND the password with your intended visitors - The password is your public IP address - Visitors will need to enter this password once every 7 days per IP 3. **For Developers (Bypassing the Password Page):** - Add a custom header `bypass-tunnel-reminder` with any value - Or set a non-standard browser User-Agent header - Note: Webhook/API calls should work without the password page ## Examples ### 1. Local Development Example ```sh # Start your local server (e.g., React app) npm start # Runs on port 3000 # In another terminal, start lorpy lorpy 3000 # Get your tunnel password (in browser or terminal) curl https://loca.lt/mytunnelpassword # Example output: 203.0.113.1 # Share with visitors: # URL: https://your-tunnel-url.loca.lt # Password: 203.0.113.1 ``` ### 2. Remote Server Example ```sh # SSH into your server ssh user@your-server # Start your application node server.js # Runs on port 8080 # Start lorpy lorpy 8080 # Get the tunnel password curl https://loca.lt/mytunnelpassword # Example output: 198.51.100.1 # Share these with visitors: # URL: https://your-tunnel-url.loca.lt # Password: 198.51.100.1 ``` ### 3. Developer API/Webhook Examples ```javascript // Using fetch with bypass header fetch('https://your-tunnel-url.loca.lt/api/data', { headers: { 'bypass-tunnel-reminder': '1' } }); // Using curl with custom User-Agent curl -H "User-Agent: my-custom-agent" \ https://your-tunnel-url.loca.lt/api/data // Using axios with bypass header axios.get('https://your-tunnel-url.loca.lt/api/data', { headers: { 'bypass-tunnel-reminder': '1' } }); ``` ## Troubleshooting - If visitors see a password page, they need your tunnel password (your public IP) - The password page appears once every 7 days per visitor IP - API/webhook calls should work without the password page - If the tunnel URL doesn't work: 1. Check if your local server is running 2. Verify the port number matches your local server 3. Try restarting lorpy --- Made with ❤️ By Nitesh-DK