aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-11-05 11:40:49 +0100
committerChocobozzz <me@florianbigard.com>2021-11-05 11:40:49 +0100
commit5037e0e474044d7fc04092158784395a001e5c25 (patch)
tree676634e1c2a712362c79f3d198def26da87d6505
parentdf1db951c512a58110171d046ef367789df02733 (diff)
downloadPeerTube-5037e0e474044d7fc04092158784395a001e5c25.tar.gz
PeerTube-5037e0e474044d7fc04092158784395a001e5c25.tar.zst
PeerTube-5037e0e474044d7fc04092158784395a001e5c25.zip
Correctly close RTMPS server too
-rw-r--r--config/production.yaml.example2
-rw-r--r--server/lib/live/live-manager.ts15
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:
386 rtmps: 386 rtmps:
387 enabled: false 387 enabled: false
388 port: 1936 388 port: 1936
389 # Absolute path
389 key_file: '' 390 key_file: ''
391 # Absolute path
390 cert_file: '' 392 cert_file: ''
391 393
392 # Allow to transcode the live streaming in multiple live resolutions 394 # 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 {
150 stop () { 150 stop () {
151 this.running = false 151 this.running = false
152 152
153 logger.info('Stopping RTMP server.', lTags()) 153 if (this.rtmpServer) {
154 logger.info('Stopping RTMP server.', lTags())
154 155
155 this.rtmpServer.close() 156 this.rtmpServer.close()
156 this.rtmpServer = undefined 157 this.rtmpServer = undefined
158 }
159
160 if (this.rtmpsServer) {
161 logger.info('Stopping RTMPS server.', lTags())
162
163 this.rtmpsServer.close()
164 this.rtmpsServer = undefined
165 }
157 166
158 // Sessions is an object 167 // Sessions is an object
159 this.getContext().sessions.forEach((session: any) => { 168 this.getContext().sessions.forEach((session: any) => {