Live video on the AT Protocol
1package cmd
2
3import (
4 "fmt"
5 "io"
6 "net/http"
7 "os"
8)
9
10func Stream(u string) error {
11 resp, err := http.Get(u)
12 if err != nil {
13 return err
14 }
15 if resp.StatusCode != 200 {
16 return fmt.Errorf("http status %s", resp.Status)
17 }
18 io.Copy(os.Stdout, resp.Body)
19 return nil
20}