#539
feat(proxy): add --bind-all to accept containers and other hosts without LAN mode
Problem
A non-LAN proxy binds 127.0.0.1 and ::1, so a Docker container that reaches the host through host-gateway gets ECONNREFUSED. --unprivileged binds the wildcard but refuses every non-loopback peer, and --lan accepts peers but forces .local and needs mDNS (#399).
Changes
--bind-all/PORTLESS_BIND_ALL=1listens on0.0.0.0and::(the proxy and its HTTP redirect listener) and accepts every peer. The TLD is unchanged, no mDNS records are published, and hosts sync works as before.- Remembered in
proxy.bind-alllike the other modes, so auto-start reuses it;PORTLESS_BIND_ALL=0switches back for one start. Carried through the sudo re-exec,service install --bind-alland theproxy_startMCP tool. - An explicit request that differs from the running proxy is rejected, as with
--lanand--unprivileged. - The elevation probe from #528 tests the wildcard targets, so macOS starts the proxy without sudo.
- With
--unprivileged, the explicit flag lifts the loopback-only peer rule. - The docs say plainly that every route becomes reachable by any machine that can reach the host.
Refs #399. Its proxy status --json half is #538, which gains a bindAll field in whichever of the two merges second.
Visual proof
macOS, a request from the machine's own LAN address (192.168.0.91), --no-tls:
default connection refused
--unprivileged connection closed
--bind-all 404 from portless
$ portless proxy start --bind-all
HTTP proxy started on port 18461
Listening on all interfaces: every route is reachable by any machine that can reach this host.Written by an AI agent (Claude) on behalf of @jasonkuhrt.
@jasonkuhrt is attempting to deploy a commit to the Vercel Labs Team on Vercel.
A member of the Team first needs to authorize it.