Commit 4b26f60
committed
fix(daemon): port probe + bind on both IPv4 and IPv6 loopback (v0.2.9)
v0.2.8 probe only checked 127.0.0.1:PORT. On macOS with AirPlay
Receiver running, the daemon cleanly bound 127.0.0.1:5000 while
AirTunes held ::1:5000 (both listen on *:5000 wildcard with
SO_REUSEADDR, so the probe succeeded). Electron's frontend hits
`http://localhost:5000/` which on macOS resolves `::1` first — and
got 403 Forbidden from AirTunes instead of the daemon's 401/200. UI
stuck on "waiting for backend" forever; daemon itself was fine if
you curl'd 127.0.0.1 directly.
Fix: probe both loopback families per port, pick only one where BOTH
are free; then bind Kestrel to `http://127.0.0.1:PORT` AND
`http://[::1]:PORT` so either resolution hits the daemon.
Verified locally on a machine running AirTunes: lsof shows daemon on
127.0.0.1:5000 + [::1]:5000, ControlCenter on *:5000 (both families),
`curl http://localhost:5000/healthz` → Kestrel (was AirTunes 403).1 parent 6d97be9 commit 4b26f60
4 files changed
Lines changed: 28 additions & 14 deletions
File tree
- src
- daemon/NKS.WebDevConsole.Daemon
- frontend
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
215 | | - | |
216 | | - | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
217 | 220 | | |
218 | 221 | | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
219 | 229 | | |
220 | 230 | | |
221 | 231 | | |
222 | | - | |
| 232 | + | |
223 | 233 | | |
224 | 234 | | |
225 | | - | |
226 | | - | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
227 | 240 | | |
228 | | - | |
229 | 241 | | |
230 | | - | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
231 | 245 | | |
232 | 246 | | |
233 | 247 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
0 commit comments