Live video on the AT Protocol

make internal API url configurable for live subcommand

+15 -5
+2 -2
pkg/cmd/live.go
··· 7 7 "os" 8 8 ) 9 9 10 - func Live(streamKey string) error { 10 + func Live(streamKey string, httpInternalAddr string) error { 11 11 // Create the URL for the live stream endpoint 12 - url := fmt.Sprintf("http://127.0.0.1:39090/live/%s", streamKey) 12 + url := fmt.Sprintf("http://%s/live/%s", httpInternalAddr, streamKey) 13 13 14 14 // Create a new HTTP request with POST method 15 15 req, err := http.NewRequest("POST", url, os.Stdin)
+13 -3
pkg/cmd/streamplace.go
··· 87 87 } 88 88 89 89 if len(os.Args) > 1 && os.Args[1] == "live" { 90 - if len(os.Args) != 3 { 91 - fmt.Println("usage: streamplace live [stream-key]") 90 + cli := config.CLI{Build: build} 91 + fs := cli.NewFlagSet("streamplace live") 92 + 93 + err := cli.Parse(fs, os.Args[2:]) 94 + if err != nil { 95 + return err 96 + } 97 + 98 + args := fs.Args() 99 + if len(args) != 1 { 100 + fmt.Println("usage: streamplace live [flags] [stream-key]") 92 101 os.Exit(1) 93 102 } 94 - return Live(os.Args[2]) 103 + 104 + return Live(args[0], cli.HTTPInternalAddr) 95 105 } 96 106 97 107 if len(os.Args) > 1 && os.Args[1] == "sign" {