summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xwebserver.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/webserver.js b/webserver.js
index 5496f11..f867c74 100755
--- a/webserver.js
+++ b/webserver.js
@@ -24,6 +24,14 @@ const httpServer = http.Server(app);
const io = socketio(httpServer);
+if ("NODE_TRUST_PROXY" in process.env && process.env["NODE_TRUST_PROXY"].length > 0) {
+ console.log("Note: Trusting reverse proxy's X-Forwarded-* headers.");
+ app.set("trust proxy", "loopback");
+} else {
+ console.log("Note: Not trusting reverse proxy. Set NODE_TRUST_PROXY to change.");
+}
+
+
// const reqlogger = new Logger("request_log.txt");