Guide
Run several tunnels from one file
Start several tunnels, for example a web app and an API, with one command.
- Applies to
- Connector 0.2.0
- Time
- About 5 minutes
- What it changes
- Opens up to 10 tunnels from one connector process.
- Last reviewed
- , by Product documentation
Before you begin
What to know before you start
- Every origin must be a loopback address. A file that names anything else is refused.
Steps
Step 1. Create a file named instawormhole.toml.
instawormhole.toml relay = "wss://relay.instawormhole.site" [[tunnel]] name = "web" origin = "127.0.0.1:3000" [[tunnel]] name = "api" origin = "127.0.0.1:8080" tunnel = "0199aa00-0000-7000-8000-00000000000c" # optional: a durable tunnel from the dashboardReplace the ports with your own. The tunnel line is optional; use the id shown on a durable tunnel in the dashboard to connect that tunnel.
You should see: The file exists in the folder where you will run the connector.
Step 2. Run the connector with the file.
Terminal npx @instawormhole/connector run --config instawormhole.toml --stored-deviceYou should see: The connector starts every tunnel in the file and prints each address.
You are done when
- Each tunnel in the file has its own public address and reaches its own app.
If something goes wrong
- The connector stops with the error config_invalid.
- The file format is strict. Only the keys shown above are allowed, with plain double-quoted strings and # comments, and up to 10 tunnels. Fix the key or value named in the message. This protects you from a typo that would expose something unexpected.
Undo or clean up
- Stop the connector with Ctrl+C.
Related
This page is part of Connect a local app. Still stuck? Contact support.