#539

feat(proxy): add --bind-all to accept containers and other hosts without LAN mode

Openjasonkuhrtwants to merge intofrom

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=1 listens on 0.0.0.0 and :: (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-all like the other modes, so auto-start reuses it; PORTLESS_BIND_ALL=0 switches back for one start. Carried through the sudo re-exec, service install --bind-all and the proxy_start MCP tool.
  • An explicit request that differs from the running proxy is rejected, as with --lan and --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.

Activity

2
vercel[bot]12d ago

@jasonkuhrt is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.