Starting a Tunnel
The primary command for Porthole is starting a new tunnel to expose your local development server.
Basic Usage
Section titled “Basic Usage”To start a tunnel for a service running on port 3000:
porthole 3000This will generate a public URL that forwards traffic to localhost:3000.
By default, Porthole uses your git repo or folder name as the subdomain. If that name is already active, it retries with a short random suffix.
Custom Subdomain
Section titled “Custom Subdomain”porthole 3000 --name design-previewIf design-preview is already in use, the CLI falls back to design-preview-<random> automatically.
Interactive UI
Section titled “Interactive UI”When a tunnel is running, Porthole provides a real-time dashboard in your terminal showing:
- Public URL: The external address of your tunnel.
- Connection Status: Real-time status of the relay connection.
- Request Log: A live stream of incoming HTTP requests.
- Stats: Total requests, uptime, and latency.
QR Code Modal
Section titled “QR Code Modal”You can quickly share or open your tunnel on a mobile device using a QR code.
- Start with QR: Use the
--qrflag to open the QR code modal immediately on start. - Toggle QR: Press
qorcwhile the tunnel is running to show or hide the QR code modal. - Close QR: Press
Escorqto close the modal.
Stopping a Tunnel
Section titled “Stopping a Tunnel”To stop the tunnel and disconnect from the relay, press Ctrl+C in the terminal where the CLI is running.