Add trustProxy option to server config

master
Mészáros Mihály 2020-03-28 21:43:25 +01:00
parent 97fc02a543
commit a925393522
2 changed files with 10 additions and 0 deletions

View File

@ -50,6 +50,12 @@ module.exports =
// listeningRedirectPort disabled // listeningRedirectPort disabled
// use case: loadbalancer backend // use case: loadbalancer backend
httpOnly : false, httpOnly : false,
// WebServer/Express trust proxy config for httpOnly mode
// You can find more info:
// - https://expressjs.com/en/guide/behind-proxies.html
// - https://www.npmjs.com/package/proxy-addr
// use case: loadbalancer backend
trustProxy : '',
// If this is set to true, only signed-in users will be able // If this is set to true, only signed-in users will be able
// to join a room directly. Non-signed-in users (guests) will // to join a room directly. Non-signed-in users (guests) will
// always be put in the lobby regardless of room lock status. // always be put in the lobby regardless of room lock status.

View File

@ -99,6 +99,10 @@ const session = expressSession({
} }
}); });
if (config.trustProxy) {
app.set('trust proxy', config.trustProxy);
}
app.use(session); app.use(session);
passport.serializeUser((user, done) => passport.serializeUser((user, done) =>