Support trust proxy

Sometimes required to set the correct protocol
 https://expressjs.com/en/4x/api.html#req.protocol
هذا الالتزام موجود في:
Johannes Zellner
2025-02-01 23:11:38 +01:00
ملتزم من قبل Johannes Zellner
الأصل 6da22eb46c
التزام 519872d898
2 ملفات معدلة مع 3 إضافات و0 حذوفات

عرض الملف

@@ -138,6 +138,7 @@ const io = socketIo(server, {
}); });
const host = config.server.hostUrl || `http://localhost:${config.server.listen.port}`; const host = config.server.hostUrl || `http://localhost:${config.server.listen.port}`;
const trustProxy = !!config.server.trustProxy;
const jwtCfg = { const jwtCfg = {
JWT_KEY: (config.jwt && config.jwt.key) || 'mirotalksfu_jwt_secret', JWT_KEY: (config.jwt && config.jwt.key) || 'mirotalksfu_jwt_secret',
@@ -357,6 +358,7 @@ function OIDCAuth(req, res, next) {
function startServer() { function startServer() {
// Start the app // Start the app
app.set('trust proxy', trustProxy);
app.use(helmet.xssFilter()); // Enable XSS protection app.use(helmet.xssFilter()); // Enable XSS protection
app.use(helmet.noSniff()); // Enable content type sniffing prevention app.use(helmet.noSniff()); // Enable content type sniffing prevention
app.use(express.static(dir.public)); app.use(express.static(dir.public));

عرض الملف

@@ -82,6 +82,7 @@ module.exports = {
ip: '0.0.0.0', ip: '0.0.0.0',
port: process.env.PORT || 3010, port: process.env.PORT || 3010,
}, },
trustProxy: false,
ssl: { ssl: {
// ssl/README.md // ssl/README.md
cert: '../ssl/cert.pem', cert: '../ssl/cert.pem',