From 5037e0e474044d7fc04092158784395a001e5c25 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 5 Nov 2021 11:40:49 +0100 Subject: [PATCH] Correctly close RTMPS server too --- config/production.yaml.example | 2 ++ server/lib/live/live-manager.ts | 15 ++++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/config/production.yaml.example b/config/production.yaml.example index 0993eb9f2..4dc5c281d 100644 --- a/config/production.yaml.example +++ b/config/production.yaml.example @@ -386,7 +386,9 @@ live: rtmps: enabled: false port: 1936 + # Absolute path key_file: '' + # Absolute path cert_file: '' # Allow to transcode the live streaming in multiple live resolutions diff --git a/server/lib/live/live-manager.ts b/server/lib/live/live-manager.ts index c75cc3bda..1b7b9dd4d 100644 --- a/server/lib/live/live-manager.ts +++ b/server/lib/live/live-manager.ts @@ -150,10 +150,19 @@ class LiveManager { stop () { this.running = false - logger.info('Stopping RTMP server.', lTags()) + if (this.rtmpServer) { + logger.info('Stopping RTMP server.', lTags()) - this.rtmpServer.close() - this.rtmpServer = undefined + this.rtmpServer.close() + this.rtmpServer = undefined + } + + if (this.rtmpsServer) { + logger.info('Stopping RTMPS server.', lTags()) + + this.rtmpsServer.close() + this.rtmpsServer = undefined + } // Sessions is an object this.getContext().sessions.forEach((session: any) => {