From 994e30eb5a2682b2716a5c5680bf43c007eff0e5 Mon Sep 17 00:00:00 2001 From: Zefanja Jobse Date: Tue, 19 Sep 2023 08:42:27 +0200 Subject: [PATCH] add keepalive --- index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 0faf7a5..cb7bd2d 100644 --- a/index.js +++ b/index.js @@ -5,6 +5,7 @@ const app = express(); const cors = require('cors') const Gamedig = require('gamedig'); const mcache = require('memory-cache'); +const port = process.env.PORT || 3035; app.use(function (req, res, next) { res.setHeader('Access-Control-Allow-Origin', '*'); @@ -74,4 +75,7 @@ app.get('/game/:gamename/:host/:port', cache(120), (req, res, next) => { var httpsServer = http.createServer({}, app); -httpsServer.listen(3035); +const server = httpsServer.listen(port, () => console.log(`App listening on port ${port}!`)); + +server.keepAliveTimeout = 120 * 1000; +server.headersTimeout = 120 * 1000; \ No newline at end of file