Predefined Tunnels
Define multiple tunnels in config and start them by name.
Overview
Instead of typing tunnel commands every time, you can define tunnels in your config file and start them by name using drip start.
Configuration
Add a tunnels section to your config file (~/.drip/config.yaml):
yaml
server: tunnel.example.com:443
token: your-token
tls: true
tunnels:
- name: web
type: http
port: 3000
subdomain: myapp
- name: api
type: http
port: 8080
subdomain: api
transport: wss
- name: db
type: tcp
port: 5432
allow_ips:
- 192.168.0.0/16
- 10.0.0.0/8Tunnel Configuration Options
| Option | Type | Description |
|---|---|---|
name | string | Unique name for the tunnel (required) |
type | string | Tunnel type: http, https, or tcp (required) |
port | int | Local port to forward (required) |
subdomain | string | Custom subdomain for HTTP/HTTPS tunnels |
address | string | Target address (default: 127.0.0.1) |
transport | string | Transport protocol: auto, tcp, wss |
allow_ips | list | IP whitelist (CIDR notation supported) |
deny_ips | list | IP blacklist (CIDR notation supported) |
Starting Tunnels
Start a Specific Tunnel
bash
drip start webStart Multiple Tunnels
bash
drip start web apiStart All Configured Tunnels
bash
drip start --allList Available Tunnels
Run drip start without arguments to see all configured tunnels:
bash
drip startExample Configurations
Development Setup
yaml
tunnels:
- name: frontend
type: http
port: 3000
subdomain: dev
- name: backend
type: http
port: 8080
subdomain: api-dev
- name: docs
type: http
port: 4000
subdomain: docs-devHome Server Setup
yaml
tunnels:
- name: nas
type: http
port: 5000
address: 192.168.1.50
subdomain: nas
- name: plex
type: http
port: 32400
address: 192.168.1.50
subdomain: plex
- name: ssh
type: tcp
port: 22
allow_ips:
- 203.0.113.50Production with Security
yaml
tunnels:
- name: staging
type: http
port: 3000
subdomain: staging
transport: wss
allow_ips:
- 10.0.0.0/8
- 192.168.0.0/16
- name: database
type: tcp
port: 5432
address: db-server
allow_ips:
- 10.0.0.100
deny_ips:
- 10.0.0.200Managing Running Tunnels
Tunnels started with drip start run in the background. Use the standard daemon commands to manage them:
bash
# List running tunnels
drip list
# View logs
drip attach http 3000
# Stop specific tunnel
drip stop http 3000
# Stop all tunnels
drip stop allBenefits
- Consistency: Same tunnel configuration every time
- Convenience: Start multiple tunnels with one command
- Documentation: Config file serves as documentation
- Version Control: Track tunnel configurations in git