Tunnels
Tunnels let you receive webhooks on your local machine during development.
Overview
When developing webhook integrations, you need a way for external services to reach your local development server. Tunnels create a secure connection from the internet to your local machine.
External Service ──▶ Hookbase Tunnel ──▶ Your Local Server
(GitHub) (*.tunnel.hookbase.app) (localhost:3000)How It Works
- Start the tunnel client on your local machine
- Get a public URL (e.g.,
abc123.tunnel.hookbase.app) - Configure your webhook provider to use this URL
- Webhooks are forwarded to your local server
Getting Started
1. Install the CLI
# npm
npm install -g @hookbase/cli
# or download binary
curl -fsSL https://get.hookbase.app | sh2. Login
hookbase login3. Start a Tunnel
# Forward to localhost:3000
hookbase tunnel --port 3000
# With custom subdomain (paid plans)
hookbase tunnel --port 3000 --subdomain myappOutput:
Tunnel established!
Public URL: https://abc123.tunnel.hookbase.app
Forwarding to: http://localhost:3000
Ready for connections...4. Use the URL
Configure your webhook provider (GitHub, Stripe, etc.) to send webhooks to your tunnel URL.
CLI Commands
Start Tunnel
# Basic usage
hookbase tunnel --port 3000
# Custom local host
hookbase tunnel --port 3000 --host 127.0.0.1
# Custom subdomain (requires paid plan)
hookbase tunnel --port 3000 --subdomain myapp
# Forward to HTTPS locally
hookbase tunnel --port 443 --local-httpsList Active Tunnels
hookbase tunnels listStop Tunnel
# Stop by subdomain
hookbase tunnel stop abc123
# Stop all
hookbase tunnel stop --allDashboard Management
You can also manage tunnels from the web dashboard:
- Navigate to Tunnels in the sidebar
- Click Create Tunnel
- Enter a subdomain (optional)
- Click Create
- Copy the connection command
Tunnel Options
| Option | Description |
|---|---|
--port | Local port to forward to |
--host | Local host (default: localhost) |
--subdomain | Custom subdomain (paid plans) |
--local-https | Use HTTPS for local connection |
--inspect | Enable request inspection UI |
Request Inspection
Enable inspection to see all requests passing through the tunnel:
hookbase tunnel --port 3000 --inspectThis opens a local web UI where you can:
- View all incoming requests
- Inspect headers and body
- Replay requests
- Filter by path or method
API Usage
Create Tunnel
curl -X POST https://api.hookbase.app/api/tunnels \
-H "Authorization: Bearer whr_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"subdomain": "myapp",
"targetPort": 3000
}'List Tunnels
curl https://api.hookbase.app/api/tunnels \
-H "Authorization: Bearer whr_your_api_key"Delete Tunnel
curl -X DELETE https://api.hookbase.app/api/tunnels/{tunnelId} \
-H "Authorization: Bearer whr_your_api_key"Use Cases
Local Development
Test webhook integrations without deploying:
# Start your local server
npm run dev # localhost:3000
# In another terminal, start the tunnel
hookbase tunnel --port 3000
# Configure GitHub to send webhooks to your tunnel URLDemo Environments
Create temporary public URLs for demos:
hookbase tunnel --port 8080 --subdomain demo
# https://demo.tunnel.hookbase.appTesting CI/CD
Test webhook-triggered pipelines locally:
hookbase tunnel --port 8080 --subdomain ci-test
# Point GitHub Actions webhook to tunnelIntegration with Sources
Tunnels can be used as destinations for routes:
- Create a tunnel
- Create a destination with the tunnel URL
- Create a route from your source to the destination
This allows you to:
- Receive production webhooks locally
- Test transforms and filters with real data
- Debug webhook handling in your IDE
Security
Encryption
All tunnel traffic is encrypted with TLS. The tunnel URL uses HTTPS.
Authentication
Tunnels are authenticated to your account. Only you can create tunnels under your organization.
Expiration
Free tier tunnels expire after 2 hours of inactivity. Paid plans have longer or unlimited tunnel sessions.
Limitations
| Plan | Tunnels | Subdomain | Session Duration |
|---|---|---|---|
| Free | 1 | Random | 2 hours |
| Starter | 2 | Custom | 8 hours |
| Pro | 5 | Custom | 24 hours |
| Business | 10 | Custom | Unlimited |
| Enterprise | Unlimited | Custom | Unlimited |
Troubleshooting
Tunnel not connecting
- Check your internet connection
- Verify you're logged in:
hookbase whoami - Check if the port is correct and your server is running
- Try a different port
Webhooks not arriving
- Verify the webhook provider is using the correct URL
- Check if your local server is running
- Enable
--inspectto see incoming requests - Check the tunnel logs for errors
Connection drops
- Check your internet stability
- The CLI will auto-reconnect on network changes
- For long-running tunnels, use a process manager
Best Practices
-
Use custom subdomains: Easier to remember and configure
-
Don't use in production: Tunnels are for development only
-
Enable inspection: Helps debug webhook issues
-
Secure your local server: Even with tunnels, follow security best practices
-
Clean up: Stop tunnels when not in use to free up resources
Bidirectional Tunnels
Standard tunnels are inbound-only: they forward external requests to your local machine. Bidirectional tunnels add outbound proxy support, allowing your local applications to make HTTP requests through Hookbase to external services.
Use Cases
- Access internal APIs or IoT devices behind firewalls
- Route outbound requests through Hookbase's infrastructure
- Test integrations with external services from local development
Creating a Bidirectional Tunnel
In the dashboard, select Bidirectional when creating a tunnel. Optionally specify allowed target hosts.
Via API:
curl -X POST https://api.hookbase.app/api/organizations/{orgId}/tunnels \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
"name": "Dev Tunnel",
"direction": "bidirectional",
"allowedHosts": ["api.internal.company.io", "iot-gateway.local"]
}'Allowed Hosts
For security, bidirectional tunnels can restrict which external hosts the proxy can reach. If allowedHosts is empty, all hosts are allowed.
| Field | Type | Description |
|---|---|---|
direction | string | inbound (default) or bidirectional |
allowedHosts | string[] | List of allowed target hostnames (max 20) |
How Outbound Proxy Works
Local App → CLI (localhost:9090) → WebSocket → Hookbase DO → External Service
← WebSocket ← Hookbase DO ←- Your local app sends a request to the CLI's proxy endpoint
- The CLI forwards it as an
outbound_requestover the existing WebSocket - Hookbase validates the target host against
allowedHosts - Hookbase makes the outbound HTTP request
- The response is sent back to your local app via the CLI
Requirements
- Plan: Pro or Business
- CLI: Use
hookbase tunnel --bidirectionalflag - Max allowed hosts: 20 per tunnel
See Also
- Tunnels API — Full API reference
- CLI — Manage tunnels from the command line
- Quick Start — Set up your first webhook pipeline
- Testing — Test webhook integrations