From ac763f37f72f78c16b7d71596ef5b88bfce792f7 Mon Sep 17 00:00:00 2001 From: Eli Mallon Date: Wed, 7 Jan 2026 16:19:47 -0800 Subject: [PATCH] config: allow RTMPS addon and regular at the same time --- pkg/cmd/streamplace.go | 7 +++---- pkg/config/config.go | 2 ++ pkg/rtmps/rtmps.go | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/pkg/cmd/streamplace.go b/pkg/cmd/streamplace.go index a7a862242..0fbd77e54 100644 --- a/pkg/cmd/streamplace.go +++ b/pkg/cmd/streamplace.go @@ -413,11 +413,10 @@ func start(build *config.BuildFlags, platformJobs []jobFunc) error { group.Go(func() error { return rtmps.ServeRTMPSAddon(ctx, &cli) }) - } else { - group.Go(func() error { - return a.ServeRTMPS(ctx, &cli) - }) } + group.Go(func() error { + return a.ServeRTMPS(ctx, &cli) + }) } else { group.Go(func() error { return a.ServeHTTP(ctx) diff --git a/pkg/config/config.go b/pkg/config/config.go index b92edd3b3..085dcd607 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -67,6 +67,7 @@ type CLI struct { HTTPSAddr string RTMPAddr string RTMPSAddr string + RTMPSAddonAddr string Secure bool NoMist bool MistAdminPort int @@ -212,6 +213,7 @@ func (cli *CLI) NewFlagSet(name string) *flag.FlagSet { fs.IntVar(&cli.RateLimitBurst, "rate-limit-burst", 0, "rate limit burst for requests per ip") fs.IntVar(&cli.RateLimitWebsocket, "rate-limit-websocket", 10, "number of concurrent websocket connections allowed per ip") fs.StringVar(&cli.RTMPServerAddon, "rtmp-server-addon", "", "address of external RTMP server to forward streams to") + fs.StringVar(&cli.RTMPSAddonAddr, "rtmps-addon-addr", ":1936", "address to listen for RTMPS on the addon server") fs.StringVar(&cli.RTMPSAddr, "rtmps-addr", ":1935", "address to listen for RTMPS connections (when --secure=true)") fs.StringVar(&cli.RTMPAddr, "rtmp-addr", ":1935", "address to listen for RTMP connections (when --secure=false)") cli.JSONFlag(fs, &cli.DiscordWebhooks, "discord-webhooks", "[]", "JSON array of Discord webhooks to send notifications to") diff --git a/pkg/rtmps/rtmps.go b/pkg/rtmps/rtmps.go index 3e1d379b4..2b3352531 100644 --- a/pkg/rtmps/rtmps.go +++ b/pkg/rtmps/rtmps.go @@ -29,13 +29,13 @@ func ServeRTMPSAddon(ctx context.Context, cli *config.CLI) error { MinVersion: tls.VersionTLS12, } - listener, err := tls.Listen("tcp", cli.RTMPAddr, tlsConfig) + listener, err := tls.Listen("tcp", cli.RTMPSAddonAddr, tlsConfig) if err != nil { return fmt.Errorf("failed to create RTMPS listener: %w", err) } log.Log(ctx, "rtmps server starting", - "addr", cli.RTMPAddr, + "addr", cli.RTMPSAddonAddr, "forwarding_to", cli.RTMPServerAddon) go func() { -- 2.51.2