From ebf8157e8cabf0144ac3c0bee7257b582ccfb933 Mon Sep 17 00:00:00 2001 From: leuc <47371249+leuc@users.noreply.github.com> Date: Sat, 22 May 2021 03:11:15 +0200 Subject: [PATCH] Fix #1001 set RTMP port from cli (#1038) --- main.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/main.go b/main.go index 3a51fcd87..267cb21d7 100644 --- a/main.go +++ b/main.go @@ -42,6 +42,7 @@ func main() { restoreDatabaseFile := flag.String("restoreDatabase", "", "Restore an Owncast database backup") newStreamKey := flag.String("streamkey", "", "Set your stream key/admin password") webServerPortOverride := flag.String("webserverport", "", "Force the web server to listen on a specific port") + rtmpPortOverride := flag.Int("rtmpport", 0, "Set listen port for the RTMP server") flag.Parse() @@ -124,6 +125,12 @@ func main() { config.WebServerPort = data.GetHTTPPortNumber() + // Set the rtmp server port + if *rtmpPortOverride > 0 { + log.Println("Saving new RTMP server port number to", *rtmpPortOverride) + data.SetRTMPPortNumber(float64(*rtmpPortOverride)) + } + // starts the core if err := core.Start(); err != nil { log.Fatalln("failed to start the core package", err)