-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathmain.go
More file actions
37 lines (26 loc) · 663 Bytes
/
main.go
File metadata and controls
37 lines (26 loc) · 663 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package main
import (
"fmt"
"os"
"github.com/akamensky/argparse"
"github.com/notedit/rtclive/config"
"github.com/notedit/rtclive/server"
)
func main() {
var err error
var cfg *config.Config
parser := argparse.NewParser("rtclive", "rtclive: WebRTC/RTMP based live streaming server")
configfile := parser.String("c", "config", &argparse.Options{Required: false, Help: "config file path", Default: "config.yaml"})
err = parser.Parse(os.Args)
if err != nil {
fmt.Println(parser.Usage(err))
return
}
cfg, err = config.LoadConfig(*configfile)
if err != nil {
fmt.Println(err)
return
}
serv := server.New(cfg)
serv.ListenAndServe()
}