Loading...
Loading...
Manage local development proxies using Caddy server's Admin API. Use when users need to allocate localhost ports, create reverse proxies for local dev servers, track which ports are in use across Claude Code sessions, or access apps via friendly URLs like myapp.localhost. Triggers on "set up a proxy", "allocate a port", "what's running on localhost", "register my app", or any Caddy configuration task.
npx skill4agent add muninn-huginn/caddy-skill caddylocalhost:2019myapp-x7k2NAME="$(basename "$PWD" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g')-$(head -c4 /dev/urandom | xxd -p | head -c4)"| Task | Command |
|---|---|
| Check status | |
| List routes | |
| Add route | |
| Delete route | |
curl -sf http://localhost:2019/config/ 2>/dev/nullbrew install caddycaddy startcurl -sf http://localhost:2019/config/apps/http/servers/local_proxies/routes 2>/dev/nullfor port in $(seq 3000 3100); do
lsof -i :$port > /dev/null 2>&1 || { echo $port; break; }
donecurl -sf http://localhost:2019/config/apps/http/servers/local_proxies > /dev/null 2>&1 || \
curl -sf -X POST http://localhost:2019/load \
-H "Content-Type: application/json" \
-d '{"apps":{"http":{"servers":{"local_proxies":{"listen":[":80"],"routes":[]}}}}}'curl -sf -X POST "http://localhost:2019/config/apps/http/servers/local_proxies/routes" \
-H "Content-Type: application/json" \
-d '{"@id":"proxy_NAME","match":[{"host":["NAME.localhost"]}],"handle":[{"handler":"reverse_proxy","upstreams":[{"dial":"localhost:PORT"}]}],"terminal":true}'curl -sf -X DELETE "http://localhost:2019/id/proxy_NAME"{
"@id": "proxy_<name>",
"match": [{"host": ["<name>.localhost"]}],
"handle": [{"handler": "reverse_proxy", "upstreams": [{"dial": "localhost:<port>"}]}],
"terminal": true
}| Error | Solution |
|---|---|
| Caddy not running | |
| Port 80 denied | |
| Route exists | Ask to update or pick different name |
*.localhost/etc/hosts