add ports to server config

This commit is contained in:
Mystikfluu 2022-06-17 20:08:03 +02:00
parent 03a5803786
commit 579ea0dd54
2 changed files with 6 additions and 2 deletions

View File

@ -899,7 +899,7 @@ router.post("/login",async function(req,res) {
app.use(router) app.use(router)
const httpServer = http.createServer(app); const httpServer = http.createServer(app);
httpServer.listen(25567); httpServer.listen(config["ports"]["http"]);
const privateKey = fs.readFileSync(config["ssl"]["privateKey"]).toString() const privateKey = fs.readFileSync(config["ssl"]["privateKey"]).toString()
const certificate = fs.readFileSync(config["ssl"]["certificate"]).toString() const certificate = fs.readFileSync(config["ssl"]["certificate"]).toString()
@ -907,7 +907,7 @@ const certificate = fs.readFileSync(config["ssl"]["certificate"]).toString()
const credentials = {key: privateKey, cert: certificate}; const credentials = {key: privateKey, cert: certificate};
const httpsServer = https.createServer(credentials, app); const httpsServer = https.createServer(credentials, app);
httpsServer.listen(25566); httpsServer.listen(config["ports"]["https"]);
const wss = new WebSocket({ const wss = new WebSocket({
server: httpsServer, server: httpsServer,

View File

@ -28,5 +28,9 @@
"privateKey": "/etc/letsencrypt/live/ipost.tk/privkey.pem", "privateKey": "/etc/letsencrypt/live/ipost.tk/privkey.pem",
"certificate" : "/etc/letsencrypt/live/ipost.tk/cert.pem" "certificate" : "/etc/letsencrypt/live/ipost.tk/cert.pem"
}, },
"ports": {
"http": 80,
"https": 443
},
"disallow_proxies_by_headers": true "disallow_proxies_by_headers": true
} }