*Add status code server to be used for extension proxy

This commit is contained in:
Derrick Hammer 2022-08-14 06:37:00 -04:00
parent 62409ac6d3
commit 00492de90c
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 19 additions and 0 deletions

View File

@ -86,6 +86,25 @@ export async function start() {
}); });
}); });
const statusCodeServer = http.createServer(function (req, res) {
// @ts-ignore
res.writeHead(req.headers["x-status"] ?? 200, {
"Content-Type": "text/plain",
});
res.end();
});
await new Promise((resolve) => {
statusCodeServer.listen(25252, "0.0.0.0", function () {
const address = statusCodeServer.address() as AddressInfo;
log.info(
"Status Code Server started on ",
`${address.address}:${address.port}`
);
resolve(null);
});
});
await setupSSl(true); await setupSSl(true);
} }