use spdy instead of plain https

This commit is contained in:
Mystikfluu
2022-08-24 21:53:59 +02:00
parent 92c8b29f57
commit 7650081220
3 changed files with 254 additions and 2 deletions
+6 -2
View File
@@ -860,7 +860,7 @@ router.get("/*", async function(request, response) {
let originalUrl = request.originalUrl.split("?").shift();
let path
let path = ""
if (existsSync(dir + "views/" + originalUrl + ".html")) {
path = dir + "views/" + originalUrl + ".html"
@@ -1048,8 +1048,12 @@ const privateKey = readFileSync(config["ssl"]["privateKey"]).toString();
const certificate = readFileSync(config["ssl"]["certificate"]).toString();
const credentials = { key: privateKey, cert: certificate };
var httpsServer;
import spdy from "spdy"
if (DID_I_FINALLY_ADD_HTTPS) {
httpsServer = https.createServer(credentials, app);
httpsServer = spdy.createServer(credentials,app)
//httpsServer = https.createServer(credentials, app);
httpsServer.listen(config["ports"]["https"], function () {
console.log(5, "HTTPS Server is listening");
});