Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@dfanso/tunnel-client) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@dfanso/tunnel-client
A powerful command-line tool that creates secure WebSocket tunnels to expose your local servers to the internet. Perfect for development, testing, and sharing your local work with others.
Features
- Instant Tunnels: Create secure tunnels to your local servers in seconds
- Secure WebSocket: Uses
wss://
for secure connections - Custom Subdomains: Choose your own subdomain or get a random one
- Auto Port Detection: Automatically finds available ports for the tunnel server
- Request Logging: Detailed logging of incoming requests and responses
- Error Handling: Robust error handling and informative error messages
Installation
# Install globally (recommended)
sudo npm install -g @dfanso/tunnel-client@1.0.2
# Or install locally in your project
npm install @dfanso/tunnel-client@1.0.2
Quick Start
- Start a tunnel:
ltunnel start
Follow the interactive prompts:
- Enter the local port to tunnel (e.g., 3000, 8000)
- Choose a subdomain (optional)
- Confirm the tunnel server details
Your tunnel is ready! You'll see:
- Local server URL
- Public tunnel URL
- Connection status
Usage Examples
Basic Usage
# Start a tunnel with interactive prompts
ltunnel start
# Start a tunnel with specific port
ltunnel start --port 3000
# Start a tunnel with custom subdomain
ltunnel start --port 3000 --subdomain myapp
Common Scenarios
Development Server
# Start your development server
npm run dev # Usually runs on port 3000
# In another terminal, start the tunnel
ltunnel start --port 3000
API Testing
# Start your API server
node server.js # Running on port 8000
# Create a tunnel to expose your API
ltunnel start --port 8000 --subdomain myapi
Configuration
The tunnel client connects to:
- Default Server:
dfanso.dev
- Default Port:
8080
- Protocol:
wss://
(WebSocket Secure)
You can override these settings during tunnel creation.
Troubleshooting
Common Issues
Port Already in Use
# Check what's using the port lsof -i :[PORT] # Kill the process kill -9 [PID]
Connection Timeout
- Verify the tunnel server is running
- Check your internet connection
- Ensure the port isn't blocked by a firewall
Permission Denied
- Use
sudo
for global installation - Check file permissions
- Use
Development
Want to contribute? Great!
- Clone the repo:
git clone https://github.com/dfanso/dfanso-tunnel-client.git
cd dfanso-tunnel-client
- Install dependencies:
npm install
- Start developing:
npm start
License
MIT dfanso
Support
Having issues? Open an issue on GitHub.