Setup a Tunneling Solution (for local dev)
This guide walks you through setting up a Tunneling solution for local development.
To test locally, you need to install a tunnel solution to get an external url
Option 1: Using localtunnel
Install
npm install -g localtunnel
Start
Assuming supervaizer server runs on port 8000 (which it does by default)
lt --port 8000
# your url is: https://silly-peaches-chapter.loca.lt
# or optionally, set your own subdomain (if available)
lt --port 8000 --subdomain my_supervaizer_agent
# your url is: https://my_supervaizer_agent.loca.lt
Make note of the full url, for example https://my_supervaizer_agent.loca.lt. Store it in the SUPERVAIZER_PUBLIC_URL environment variable.
Option 2: Using ngrok
Installation
- macOS
- Windows
- Linux (apt)
brew install ngrok
Install via the Windows App Store
curl -sSL https://ngrok-agent.s3.amazonaws.com/ngrok.asc \
| sudo tee /etc/apt/trusted.gpg.d/ngrok.asc >/dev/null \
&& echo "deb https://ngrok-agent.s3.amazonaws.com bookworm main" \
| sudo tee /etc/apt/sources.list.d/ngrok.list \
&& sudo apt update \
&& sudo apt install ngrok
Setup & Deploy
Sign up to ngrok (free with limitations) to get a token
ngrok config add-authtoken <token>
ngrok http 8000
# Or -optionally try to set the url (paid plans)
ngrok http 8000 --url my_supervaizer_agent.ngrok.dev
Update update available (version 3.26.0, Ctrl-U to update)
Version 3.22.1
Region United States (us)
Web Interface http://127.0.0.1:4040
Forwarding https://e83bc6b8acec.ngrok-free.app -> http://localhost:8000
Make note of the full url, for example https://my_supervaizer_agent.ngrok.dev. Store it in the SUPERVAIZER_PUBLIC_URL environment variable.
Set the public url
Give the url to the controller with an environment variable or with an option of supervaizer start.
export SUPERVAIZER_PUBLIC_URL=https://my_supervaizer_agent.loca.lt
supervaizer start
# or use the option
supervaizer start --public-url https://my_supervaizer_agent.loca.lt
The --public-url option has priority over the environment variable.
SUPERVAIZER_HOST is the address that the server binds to. Do not put the tunnel host name in it.