diff --git a/src/server.ts b/src/server.ts index 240800c1e2..1429cdfebf 100644 --- a/src/server.ts +++ b/src/server.ts @@ -3,8 +3,7 @@ */ import * as fs from 'fs'; -import * as http from 'http'; -import * as https from 'https'; +import * as http2 from 'http2'; import * as cluster from 'cluster'; import * as express from 'express'; import * as morgan from 'morgan'; @@ -56,12 +55,12 @@ app.use(require('./web/server')); * Create server */ const server = config.https.enable ? - https.createServer({ + http2.createSecureServer({ key: fs.readFileSync(config.https.key), cert: fs.readFileSync(config.https.cert), ca: fs.readFileSync(config.https.ca) }, app) : - http.createServer(app); + http2.createServer(app); /** * Steaming