From 9065996abd6f75f60640dacca797cc333b728fbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9sz=C3=A1ros=20Mih=C3=A1ly?= Date: Sat, 28 Mar 2020 21:43:25 +0100 Subject: [PATCH] Add trustProxy option to server config --- server/config/config.example.js | 6 ++++++ server/server.js | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/server/config/config.example.js b/server/config/config.example.js index 53b1f05..b33c04b 100644 --- a/server/config/config.example.js +++ b/server/config/config.example.js @@ -64,6 +64,12 @@ module.exports = // listeningRedirectPort disabled // use case: loadbalancer backend 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 : '', // This function will be called on successful login through oidc. // Use this function to map your oidc userinfo to the Peer object. // The roomId is equal to the room name. diff --git a/server/server.js b/server/server.js index c1c0f61..853cd47 100755 --- a/server/server.js +++ b/server/server.js @@ -100,6 +100,10 @@ const session = expressSession({ } }); +if (config.trustProxy) { + app.set('trust proxy', config.trustProxy); +} + app.use(session); passport.serializeUser((user, done) =>