1.0.9 • Published 11 months ago

@dfanso/tunnel-client v1.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

@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.

Version License

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

  1. Start a tunnel:
ltunnel start
  1. Follow the interactive prompts:

    • Enter the local port to tunnel (e.g., 3000, 8000)
    • Choose a subdomain (optional)
    • Confirm the tunnel server details
  2. 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

  1. Port Already in Use

    # Check what's using the port
    lsof -i :[PORT]
    
    # Kill the process
    kill -9 [PID]
  2. Connection Timeout

    • Verify the tunnel server is running
    • Check your internet connection
    • Ensure the port isn't blocked by a firewall
  3. Permission Denied

    • Use sudo for global installation
    • Check file permissions

Development

Want to contribute? Great!

  1. Clone the repo:
git clone https://github.com/dfanso/dfanso-tunnel-client.git
cd dfanso-tunnel-client
  1. Install dependencies:
npm install
  1. Start developing:
npm start

License

MIT dfanso

Support

Having issues? Open an issue on GitHub.

1.0.9

11 months ago

1.0.8

11 months ago

1.0.7

11 months ago

1.0.6

11 months ago

1.0.5

11 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago