Trying with http2

This commit is contained in:
Kasper Rynning-Tønnesen
2018-03-09 14:01:40 +01:00
parent ee085bcf07
commit 913382c7f2
4 changed files with 9 additions and 2 deletions

5
package-lock.json generated
View File

@@ -1432,6 +1432,11 @@
"sshpk": "https://registry.npmjs.org/sshpk/-/sshpk-1.13.1.tgz"
}
},
"http2": {
"version": "3.3.7",
"resolved": "https://registry.npmjs.org/http2/-/http2-3.3.7.tgz",
"integrity": "sha512-puSi8M8WNlFJm9Pk4c/Mbz9Gwparuj3gO9/RRO5zv6piQ0FY+9Qywp0PdWshYgsMJSalixFY7eC6oPu0zRxLAQ=="
},
"iconv-lite": {
"version": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz",
"integrity": "sha1-90aPYBNfXl2tM5nAqBvpoWA6CCs="

View File

@@ -45,6 +45,7 @@
"gulp-concat": "^2.6.1",
"gulp-uglifyjs": "^0.6.2",
"gulp-util": "^3.0.8",
"http2": "^3.3.7",
"jimp": "^0.2.28",
"mobile-detect": "^1.3.7",
"mongodb": "^2.0.27",

View File

@@ -78,10 +78,10 @@ function startSingle(clustered, redis_enabled) {
ca: ca
};
var https = require('https');
server = https.Server(credentials, routingFunction);
server = require('http2').createServer(credentials, routingFunction);
} catch(err){
console.log("Starting without https (probably on localhost)");
server = http.createServer(routingFunction);
server = require('http2').createServer(routingFunction);
}
if(clustered) {

View File

@@ -146,6 +146,7 @@ if(!Helper.mobilecheck()) {
window.onerror = function(e) {
if(e == "Script error.") return true;
Helper.logs.unshift({log: e.toString().replace(/(\r\n|\n|\r)/gm,""), date: new Date()});
Helper.logs.unshift({log: chan.toLowerCase(), date: new Date()});
$(".contact-form-content").remove();
$("#submit-contact-form").remove();
$(".contact-modal-header").text("An error occurred");