Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Correctly close RTMPS server too

Chocobozzz5037e0e47404
diff --git a/config/production.yaml.example b/config/production.yaml.example
index 0993eb9f2a..4dc5c281de 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 c75cc3bda4..1b7b9dd4d6 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) => {