From d24289007595408fd93b300d68225230622a25aa Mon Sep 17 00:00:00 2001 From: Teoh Han Hui Date: Wed, 28 Jul 2021 22:32:29 +0800 Subject: [PATCH] Set `trust proxy` setting to true This prevents http/https mismatch when the server is behind a proxy (e.g. Heroku or Cloudflare) --- lobby.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lobby.js b/lobby.js index 4b7e085..1feb943 100644 --- a/lobby.js +++ b/lobby.js @@ -12,6 +12,8 @@ module.exports.Lobby=function(http, config) var app = express(); var rooms = {}; +app.set('trust proxy', true); + app.use(cors()); app.use('/', express.static(__dirname + '/public'));