Commit faa78b4
proxy: bind loopback on both IPv4 and IPv6 so
The proxy bound only 127.0.0.1 (IPv4). On macOS `localhost` resolves to ::1
(IPv6) first, so if another process holds a wildcard IPv6 listener on the same
port (e.g. OrbStack/Docker on *:PORT with SO_REUSEPORT), the IPv4-only bind
still succeeds but never receives `localhost` traffic — it lands on the other
listener, which resets it. The proxy looked healthy ("Ctrl-C to stop") while
every request failed with "connection reset by peer".
Bind loopback on both 127.0.0.1 and ::1 (single site for an explicit
non-loopback --address). Binding the specific loopback addresses wins over a
wildcard listener, so localhost reaches the proxy; a genuinely conflicting
specific bind now surfaces as a loud EADDRINUSE instead of a silent half-bind.
IPv6-unavailable hosts fall back to IPv4 with a note.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>localhost isn't shadowed1 parent c425c88 commit faa78b4
1 file changed
Lines changed: 42 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
169 | 170 | | |
170 | 171 | | |
171 | 172 | | |
172 | | - | |
173 | | - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
174 | 182 | | |
175 | 183 | | |
176 | | - | |
177 | | - | |
178 | | - | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
179 | 215 | | |
180 | | - | |
| 216 | + | |
181 | 217 | | |
182 | 218 | | |
183 | 219 | | |
| |||
0 commit comments