Fix http server issue with node >= v20.13.0

This commit is contained in:
yflory 2024-05-16 16:58:39 +02:00
parent 7a259264e4
commit 4483b848ff
1 changed files with 2 additions and 1 deletions

View File

@ -735,7 +735,8 @@ var server = Http.createServer(app);
nThen(function (w) {
server.listen(Env.httpPort, Env.httpAddress, w());
if (Env.httpSafePort) {
server.listen(Env.httpSafePort, Env.httpAddress, w());
let safeServer = Http.createServer(app);
safeServer.listen(Env.httpSafePort, Env.httpAddress, w());
}
server.on('upgrade', function (req, socket, head) {
// TODO warn admins that websockets should only be proxied in this way in a dev environment