]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Correctly close RTMPS server too
authorChocobozzz <me@florianbigard.com>
Fri, 5 Nov 2021 10:40:49 +0000 (11:40 +0100)
committerChocobozzz <me@florianbigard.com>
Fri, 5 Nov 2021 10:40:49 +0000 (11:40 +0100)
config/production.yaml.example
server/lib/live/live-manager.ts

index 0993eb9f2a35e4c2a72d89197eeadc90b98acbef..4dc5c281def176b07517542957be9673d8c3fa70 100644 (file)
@@ -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
index c75cc3bda4bf986de39b0bd5aca23f2ca29d6b1c..1b7b9dd4d6f3cc20287030818d7085b7b886e600 100644 (file)
@@ -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) => {