diff --git a/src/RootData.ts b/src/RootData.ts index bf89456f..68794993 100644 --- a/src/RootData.ts +++ b/src/RootData.ts @@ -47,6 +47,7 @@ export class RootData { public files: {}; // List of uploaded files handled. public publicAddress: string; // URI for BotServer. public server: any; // Express reference. + public httpsServer: any; // Express reference (HTTPS). public sysPackages: any[]; // Loaded system package list. public appPackages: any[]; // Loaded .gbapp package list. public minService: GBMinService; // Minimalist service core. diff --git a/src/app.ts b/src/app.ts index 9bf6da00..ad139aa5 100644 --- a/src/app.ts +++ b/src/app.ts @@ -85,6 +85,7 @@ export class GBServer { const server = express(); GBServer.globals.server = server; + GBServer.globals.httpsServer = null; GBServer.globals.webSessions = {}; GBServer.globals.processes = {}; GBServer.globals.files = {}; @@ -256,7 +257,7 @@ export class GBServer { pfx: Fs.readFileSync(process.env.CERTIFICATE_PFX) }; const httpsServer = https.createServer(options1, server).listen(port, mainCallback); - + GBServer.globals.httpsServer = httpsServer; if (process.env.CERTIFICATE2_PFX) { const options2 = { passphrase: process.env.CERTIFICATE2_PASSPHRASE,