From 4de267e5654019845d5ce377a4937706e3d076fb Mon Sep 17 00:00:00 2001 From: "Natalie B." <22222885+espeon@users.noreply.github.com> Date: Wed, 16 Jul 2025 13:42:44 -0500 Subject: [PATCH] make internal API url configurable for live subcommand --- pkg/cmd/live.go | 4 ++-- pkg/cmd/streamplace.go | 16 +++++++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/pkg/cmd/live.go b/pkg/cmd/live.go index d66c01341..1a814b164 100644 --- a/pkg/cmd/live.go +++ b/pkg/cmd/live.go @@ -7,9 +7,9 @@ import ( "os" ) -func Live(streamKey string) error { +func Live(streamKey string, httpInternalAddr string) error { // Create the URL for the live stream endpoint - url := fmt.Sprintf("http://127.0.0.1:39090/live/%s", streamKey) + url := fmt.Sprintf("http://%s/live/%s", httpInternalAddr, streamKey) // Create a new HTTP request with POST method req, err := http.NewRequest("POST", url, os.Stdin) diff --git a/pkg/cmd/streamplace.go b/pkg/cmd/streamplace.go index 958a8394d..5860036b1 100644 --- a/pkg/cmd/streamplace.go +++ b/pkg/cmd/streamplace.go @@ -87,11 +87,21 @@ func start(build *config.BuildFlags, platformJobs []jobFunc) error { } if len(os.Args) > 1 && os.Args[1] == "live" { - if len(os.Args) != 3 { - fmt.Println("usage: streamplace live [stream-key]") + cli := config.CLI{Build: build} + fs := cli.NewFlagSet("streamplace live") + + err := cli.Parse(fs, os.Args[2:]) + if err != nil { + return err + } + + args := fs.Args() + if len(args) != 1 { + fmt.Println("usage: streamplace live [flags] [stream-key]") os.Exit(1) } - return Live(os.Args[2]) + + return Live(args[0], cli.HTTPInternalAddr) } if len(os.Args) > 1 && os.Args[1] == "sign" { -- 2.51.2