Defaults to all-interfaces as before. Setting HOST=127.0.0.1 binds loopback so the viewer can sit behind a `tailscale serve` proxy without colliding with tailscaled's own bind on the tailnet IP:port.
Unified · Split
| @@ -78,4 +78,6 @@ createServer((req, res) => { · 77 unmodified lines | |||
| 78 | } | 78 | } |
| 79 | res.writeHead(200, { "content-type": type, "content-length": size, "accept-ranges": "bytes" }); | 79 | res.writeHead(200, { "content-type": type, "content-length": size, "accept-ranges": "bytes" }); |
| 80 | createReadStream(file).pipe(res); | 80 | createReadStream(file).pipe(res); |
| 81 | }).listen(PORT, () => console.log(`e2e viewer → http://localhost:${PORT}/`)); | 81 | }).listen(PORT, process.env.HOST || undefined, () => |
| 82 | console.log(`e2e viewer → http://${process.env.HOST ?? "localhost"}:${PORT}/`), | ||
| 83 | ); | ||