fix: bridge respawned child signals (#933) (thanks @roshanasingh4)

Co-authored-by: Roshan Singh <roshanasingh4@users.noreply.github.com>
This commit is contained in:
Peter Steinberger
2026-01-15 06:37:27 +00:00
parent d9f2ee40f7
commit 154b8e3e0e
6 changed files with 80 additions and 50 deletions

View File

@@ -0,0 +1,19 @@
import http from "node:http";
const server = http.createServer((_, res) => {
res.writeHead(200, { "content-type": "text/plain" });
res.end("ok");
});
server.listen(0, "127.0.0.1", () => {
const addr = server.address();
if (!addr || typeof addr === "string") throw new Error("unexpected address");
process.stdout.write(`${addr.port}\n`);
});
const shutdown = () => {
server.close(() => process.exit(0));
};
process.on("SIGTERM", shutdown);
process.on("SIGINT", shutdown);