Fix websocket only binds to localhost #1182

This commit is contained in:
yflory 2023-08-18 10:40:35 +02:00
parent 22747cb380
commit 650e4c42ca
2 changed files with 3 additions and 3 deletions

View File

@ -599,9 +599,9 @@ app.use(function (err, req, res /*, next*/) {
var server = Http.createServer(app);
nThen(function (w) {
server.listen(Env.httpPort, w());
server.listen(Env.httpPort, Env.httpAddress, w());
if (Env.httpSafePort) {
server.listen(Env.httpSafePort, w());
server.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

View File

@ -81,7 +81,7 @@ nThen(function (w) {
process.exit(1);
}
Env.httpServer = Http.createServer(app);
Env.httpServer.listen(Env.websocketPort, 'localhost', w(function () {
Env.httpServer.listen(Env.websocketPort, Env.httpAddress, w(function () {
Env.Log.info('WEBSOCKET_LISTENING', {
port: Env.websocketPort,
});