Support trust proxy
Sometimes required to set the correct protocol https://expressjs.com/en/4x/api.html#req.protocol
هذا الالتزام موجود في:
ملتزم من قبل
Johannes Zellner
الأصل
6da22eb46c
التزام
519872d898
@@ -138,6 +138,7 @@ const io = socketIo(server, {
|
||||
});
|
||||
|
||||
const host = config.server.hostUrl || `http://localhost:${config.server.listen.port}`;
|
||||
const trustProxy = !!config.server.trustProxy;
|
||||
|
||||
const jwtCfg = {
|
||||
JWT_KEY: (config.jwt && config.jwt.key) || 'mirotalksfu_jwt_secret',
|
||||
@@ -357,6 +358,7 @@ function OIDCAuth(req, res, next) {
|
||||
|
||||
function startServer() {
|
||||
// Start the app
|
||||
app.set('trust proxy', trustProxy);
|
||||
app.use(helmet.xssFilter()); // Enable XSS protection
|
||||
app.use(helmet.noSniff()); // Enable content type sniffing prevention
|
||||
app.use(express.static(dir.public));
|
||||
|
||||
@@ -82,6 +82,7 @@ module.exports = {
|
||||
ip: '0.0.0.0',
|
||||
port: process.env.PORT || 3010,
|
||||
},
|
||||
trustProxy: false,
|
||||
ssl: {
|
||||
// ssl/README.md
|
||||
cert: '../ssl/cert.pem',
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم