#581
Serve --tld beside .local in LAN mode
- LAN mode served
.localnames only.--tldwas dropped with a warning, and the proxy then refused a certificate for, and routed nothing to, a name under any other TLD. Turning on LAN mode to test on a phone took every.localhostURL on the machine down. - That matters for AI coding agents as well as for #346's OAuth case. Some agents treat
.localhostand.testas the only safe local hosts and will sign in with a test account, enter a test key, or submit a form only there. A.localname doesn't qualify, since other devices on the network can reach it, so while the proxy is in LAN mode an agent can't use the app it just started. - With
--lan, the proxy now serves the TLDs given with--tldin their order, adding.locallast when it's missing:--lan --tld comserves.com, .local, and--lan --tld local --tld localhostkeeps.localfirst.--lanalone still serves.localonly. The same holds forproxy start, its background start,service install, and the TLD collision check beforerun. - mDNS announces only the
.localnames. Names under the other TLDs resolve on this machine only, as they do outside LAN mode. - An app's
PORTLESS_TLDmay now name any TLD the running proxy serves, and that TLD becomes itsPORTLESS_URL's. Before, anyPORTLESS_TLDthat wasn't exactly the proxy's list stoppedrunwith a config mismatch. So a person can usemyapp.localfrom a phone while an agent on the same machine runs withPORTLESS_TLD=localhostand getsmyapp.localhost. TheLAN ->line names the.localURL. - README, the skill, the docs pages,
--help,service --helpand the MCP help say so. - Closes #346.
Tested
- New tests in
cli-utils.test.ts,service.test.tsandcli.test.ts. The two privileged proxy tests incli.test.tsfail on my machine only because a proxy already holds port 443, as they do onmain. - On a throwaway proxy (its own state directory, port 9443,
--lan --ip 127.0.0.1 --tld localhost), one app with noPORTLESS_TLDand one withPORTLESS_TLD=localeach answered over HTTPS on both its.localhostand.localnames, with thePORTLESS_URLit asked for. - An earlier version of this change, applied to 0.17.0's build as a patch, runs my LAN proxy now. mDNS announcing only
.localnames hasn't been checked from another device.
Activity
2This pull request is a draft
Merging is unavailable until it is marked ready for review.
@gkurt is attempting to deploy a commit to the Vercel Labs Team on Vercel.
A member of the Team first needs to authorize it.