⚠️ Please don't use this for anything. This is used as part of a demo for Tailscale.
- tsnet Integration: Run as a Tailscale node directly without requiring a separate Tailscale client
- Automatic TLS: Get free HTTPS certificates automatically via Tailscale
- User Identity: Shows logged-in Tailscale user information
- Prometheus Metrics: Built-in metrics collection
- Flexible Deployment: Can run in traditional mode or as a tsnet node
The easiest way to run this demo is using Docker with tsnet mode:
-
Get a Tailscale auth key from https://login.tailscale.com/admin/settings/keys
-
Copy the environment template:
cp .env.example .env # Edit .env and add your TAILSCALE_AUTHKEY
-
Run with Docker Compose:
docker-compose up -d
The application will:
- Register itself as a node in your Tailscale network
- Generate and manage TLS certificates automatically
- Be accessible at
https://demo-streamer.<your-tailnet>.ts.net
(or your custom hostname)
Environment Variable | Flag | Default | Description |
---|---|---|---|
PORT |
--port |
8080 |
Port to listen on (traditional mode only) |
DEV |
--dev |
false |
Enable development mode |
TSNET |
--tsnet |
false |
Enable tsnet mode for Tailscale integration |
HOSTNAME |
--hostname |
tailscale-demo-streamer |
Hostname for tsnet registration |
TAILSCALE_AUTHKEY |
--auth-key |
Tailscale auth key for tsnet | |
TLS |
--tls |
true |
Enable TLS certificate generation (tsnet mode) |
Traditional mode (requires Tailscale client installed):
./demo-streamer --port 8080
tsnet mode (registers as Tailscale node directly):
./demo-streamer --tsnet --auth-key=tskey-auth-your-key --hostname=my-demo
Development mode (serves assets from filesystem):
./demo-streamer --dev --tsnet --auth-key=tskey-auth-your-key
# Install dependencies
go mod download
# Run in development mode
make dev
# Build binary
make build
# Run with custom version info
make VERSION=1.0.0 build
Traditional mode:
docker build --tag demo-streamer .
docker run --publish 8080:8080 demo-streamer /app/demo-streamer --port 8080
tsnet mode:
docker build --tag demo-streamer .
docker run -e TAILSCALE_AUTHKEY=your-auth-key demo-streamer
# Copy and edit environment variables
cp .env.example .env
# Start the service
docker-compose up -d
# View logs
docker-compose logs -f
# Stop the service
docker-compose down
apt-get update
apt-get install -y golang
go install github.com/tailscale-dev/demo-streamer@latest
nohup ./go/bin/demo-streamer &
or
curl -fsSL https://raw.githubusercontent.com/tailscale-dev/demo-streamer/main/run_ubuntu.sh | sh
If you prefer to use the traditional Tailscale client instead of tsnet:
- Install and configure Tailscale on your system
- Run the application in traditional mode:
./demo-streamer --port 8080
- Enable Tailscale Serve/Funnel:
tailscale serve https / http://127.0.0.1:8080 tailscale funnel 443 on
/
- Main application with user identity display/api/uuid
- Generate a random UUID/metrics
- Prometheus metrics/ui/*
- Static assets
The application includes build information that helps with debugging the "ERR-BuildInfo" issue in Tailscale console:
./demo-streamer --version