self-hosted http tunnels for exposing a local web app through your own vps and domain.
localhost:3000 -> https://quiet-forest.tunnel.example.comTUNNEL_SERVER_TOKEN=secret go run ./cmd/tunneld./scripts/test_endpoint.shTUNNEL_TOKEN=secret go run ./cmd/tunnel http 5050open the printed url:
http://quiet-forest.localhost:8080point both records to your vps:
A tunnel.ankurgajurel.com.np <VPS_IP>
A *.tunnel.ankurgajurel.com.np <VPS_IP>TUNNEL_HTTP_ADDR=:8080
TUNNEL_BASE_DOMAIN=tunnel.ankurgajurel.com.np
TUNNEL_PUBLIC_URL=https://tunnel.ankurgajurel.com.np
TUNNEL_SERVER_TOKEN=change-merun only tunneld:
docker run -d \
--name tunneld \
--restart unless-stopped \
-e TUNNEL_HTTP_ADDR=:8080 \
-e TUNNEL_BASE_DOMAIN=tunnel.ankurgajurel.com.np \
-e TUNNEL_PUBLIC_URL=https://tunnel.ankurgajurel.com.np \
-e TUNNEL_SERVER_TOKEN=change-me \
-p 127.0.0.1:8080:8080 \
ghcr.io/ankurgajurel/tunneld:latestcaddy example:
tunnel.ankurgajurel.com.np, *.tunnel.ankurgajurel.com.np {
reverse_proxy 127.0.0.1:8080
}wildcard https with cloudflare needs caddy dns-01 support.
cp .env.example .env
docker compose -f deploy/docker-compose.yml up -dlogs:
docker compose -f deploy/docker-compose.yml logs -fdownload the tunnel binary from github releases, or build locally:
curl -fsSL https://raw.githubusercontent.com/ankurgajurel/tunnel/master/scripts/install.sh | shuninstall:
curl -fsSL https://raw.githubusercontent.com/ankurgajurel/tunnel/master/scripts/uninstall.sh | shgo build -o tunnel ./cmd/tunnellogin once:
tunnel logincheck what the cli will use:
tunnel configthen expose a local port:
tunnel http 3000or override config for one run:
tunnel http 3000 --server-url http://localhost:8080 --token secret --workers 2clear saved cli config:
tunnel logoutor use env vars:
TUNNEL_SERVER_URL=https://tunnel.ankurgajurel.com.np \
TUNNEL_TOKEN=change-me \
go run ./cmd/tunnel http 3000the cli prints:
https://quiet-forest.tunnel.ankurgajurel.com.nppush a tag to build cli binaries:
make release VERSION=v0.1.0- http only
- in-memory tunnel state
- shared token auth
- no dashboard
- no tcp tunnels
- agent transport uses websocket workers