local-urllisted
Install: claude install-skill y-a-v-a/skills
# Local URL
Goal: `http://<name>.localhost:<port>` opens the app from a bookmark on this machine.
The server keeps its bind address and port; nothing that worked before stops working.
## Why `.localhost`
- RFC 6761 reserves `localhost` and every name under it for loopback. Chrome and
Firefox answer `*.localhost` themselves, and the macOS resolver does too, so Safari,
curl and the rest get 127.0.0.1 / ::1 with no hosts file, no sudo, no DNS.
- No public DNS name can claim it, so admitting it to a Host guard does not reopen
DNS rebinding.
- Not `.local`: that is mDNS/Bonjour, with slow lookups and name collisions.
## Steps
1. **Find what serves the app**: port, bind address, how it runs (npm script, launchd
or systemd unit, Docker, framework dev server). Pick the name: the app's short
name, lowercase, e.g. `symposium.localhost`. Keep the port; dropping it means
port 80, which only one app on the machine can have.
2. **Ask the machine before touching code:**
```bash
dscacheutil -q host -a name <name>.localhost # macOS: expect 127.0.0.1 and ::1
getent hosts <name>.localhost # Linux, see below if empty
curl -s -o /dev/null -w '%{http_code}\n' http://<name>.localhost:<port>/
```
- 200: it already works; skip to step 5.
- 400, 403, "Invalid Host header", "Blocked request": a host allow-list; step 3.
- Connection refused: nothing listens on the address the name resolved to; see
Pitfalls.
Resolution: on macOS t