Lokale services publiek maken met ASD Tunnels
ASD biedt meerdere manieren om lokale services bereikbaar te maken via het internet. Van een snelle one-liner tot een volledige projectconfiguratie — kies de methode die bij je workflow past. Deze gids behandelt alle drie de benaderingen en wanneer je welke gebruikt.
Drie manieren om tunnels te maken
| Behoefte | Methode | Complexiteit |
|---|---|---|
| Nu iets delen | asd expose | Simpelst |
| Dagelijkse ontwikkeling | asd.yaml config | Gemiddeld |
| CI/CD automatisering | Tunnel tokens | Geavanceerd |
Methode 1: Quick expose
De snelste manier om een lokale poort te delen. Eén commando, direct resultaat:
asd expose 3000Output:
Local: http://localhost:3000
Caddy: http://app.localhost
Tunnel: https://app-abc123.cicd.eu1.asd.engineerEigen namen
Geef je tunnel een herkenbare URL-prefix:
asd expose 3000 --name myapp
# Resultaat: https://myapp-abc123.cicd.eu1.asd.engineerDirecte tunnel (zonder Caddy)
Als je de lokale Caddy proxy niet nodig hebt, gebruik --direct
om een tunnel direct naar je service te maken:
asd expose 3000 myapp --directExposed services beheren
# Toon alle exposed services met hun URLs
asd expose list
# Stop op naam
asd expose stop myapp
# Stop op poort
asd expose stop 3000Ideaal voor: Snelle demo's, eenmalig delen, webhooks testen.
Methode 2: Projectconfiguratie (asd.yaml)
Voor doorlopende ontwikkeling definieer je services in asd.yaml.
Dit geeft je herhaalbare configuratie, meerdere services, en lokale routing
via Caddy.
Project initialiseren
cd jouw-project
asd initDit maakt asd.yaml aan en zet de workspace op.
Services definiëren
version: 1
project:
name: "my-app"
network:
services:
frontend:
dial: "127.0.0.1:3000"
host: "app.localhost"
public: true
subdomain: "frontend"
api:
dial: "127.0.0.1:8080"
paths: ["/api"]
public: true
subdomain: "api"Elke service krijgt:
dial— het lokale adres en de poorthost— een optionele lokale hostname voor Caddy routingpaths— pad-gebaseerde routing (bijv./api)public: true— schakelt de publieke tunnel insubdomain— prefix voor de tunnel-URL
Toepassen en starten
# Config toepassen, Caddy en tunnels starten
asd net apply --caddy --tunnel
# Open de netwerk-TUI om alles te zien
asd netDe TUI toont alle services, hun gezondheid, en toegangs-URL's:
| Toets | Actie |
|---|---|
Tab | Wissel tabs (Services, Projects, Logs) |
Enter | Actiemenu voor geselecteerde service |
Ctrl+R | Gezondheid verversen |
Ctrl+Q | Afsluiten |
Ideaal voor: Dagelijkse ontwikkeling, teamprojecten, meerdere services.
Methode 3: Tunnel tokens (CI/CD)
Voor geautomatiseerde omgevingen zoals GitHub Actions of GitLab CI gebruik je tunnel tokens in plaats van interactieve authenticatie.
Tijdelijke tokens (snel testen)
Geen account nodig. Verkrijg direct 5 minuten credentials:
curl -X POST https://asd.engineer/functions/v1/create-ephemeral-tokenPermanente tokens (CI/CD pipelines)
- Registreer op asd.host
- Ga naar Account → Tunnel Tokens → Aanmaken
- Voeg credentials toe als CI-secrets:
ASD_TUNNEL_TOKEN=jouw-token-van-dashboard
ASD_TUNNEL_USER=jouw-gebruikers-idDan in je CI-pipeline:
asd expose 3000Ideaal voor: CI/CD pipelines, geautomatiseerd testen, webhook receivers.
Meerdere services tegelijk
Met asd.yaml kun je meerdere services tegelijk exposen. Elke
service krijgt een eigen tunnel-URL:
network:
services:
frontend:
dial: "127.0.0.1:3000"
host: "app.localhost"
public: true
subdomain: "frontend"
api:
dial: "127.0.0.1:8080"
paths: ["/api"]
public: true
subdomain: "api"
docs:
dial: "127.0.0.1:4000"
host: "docs.localhost"
public: true
subdomain: "docs"asd net apply --caddy --tunnelAlle drie de services krijgen unieke tunnel-URL's en lokale Caddy routes.
Toegangspatronen
Elke exposed service is op drie manieren bereikbaar:
| Patroon | URL Voorbeeld | Gebruik |
|---|---|---|
| Lokaal Direct | http://localhost:3000 |
Zelfde machine |
| Caddy Route | http://app.localhost |
Lokaal netwerk, LAN |
| Tunnel Remote | https://frontend-abc123.cicd.eu1.asd.engineer |
Overal op het internet |
Browser → ASD Cloud → SSH Tunnel → Caddy (lokaal) → Jouw Service
(versleuteld) ↑
Routes + AuthAuthenticatie toevoegen
Standaard kan iedereen met de tunnel-URL je service benaderen. Voeg een
wachtwoord toe met basic_auth in asd.yaml:
network:
caddy:
basic_auth:
enabled: true
realm: "Mijn Project"
services:
my-app:
dial: "127.0.0.1:3000"
public: trueStel credentials in via .env:
ASD_BASIC_AUTH_USERNAME=admin
ASD_BASIC_AUTH_PASSWORD=jouw-veilige-wachtwoordZie de Caddy Basic Auth gids voor gedetailleerde configuratie-opties.
Problemen oplossen
| Probleem | Oplossing |
|---|---|
| Tunnel maakt geen verbinding | Controleer credentials: asd tunnel auth status |
| Poort al in gebruik | asd expose stop 3000 of lsof -i :3000 |
| Service niet in TUI | asd net refresh om services opnieuw te scannen |
| Caddy start niet | asd caddy stop, verwijder .asd/workspace/caddy/, herstart |
Wat nu
- asd.yaml configureren — volledige referentie voor projectconfiguratie
- Basic authenticatie toevoegen — bescherm je exposed services
- Live Terminal in CI — gebruik ASD tunnels in GitHub Actions
Kelvin Wuite
Kelvin Wuite is the founder of ASD B.V. With over eighteen years of development experience, he has witnessed the same patterns repeat across every software team - endless documentation, manual preparation, environment mismatches, and fragmented collaboration. His drive is to remove these barriers, enabling engineers to work together in unified environments with shorter feedback loops and hands-on collaboration. Since 2015 he has been refining these ideas, leading to ASD — a platform designed to create a faster, more integrated way for development teams to collaborate in an age where AI is thriving.
Related Articles
How to Create Your First HTTPS Tunnel in 30 Seconds
Install ASD CLI and expose your local development server to the internet with a public HTTPS URL. One command, 30 seconds, no configuration needed.
ConfigurationHow to Configure asd.yaml for Your Project
Complete guide to configuring asd.yaml: define services, set up networking, add authentication, create automation tasks, and configure plugins for your project.
ServicesHow to Set Up a Web Terminal with ttyd
Set up a browser-based terminal with ttyd and ASD. Access your development machine from any device, anywhere, with password protection and HTTPS tunneling.