Skip to content

Commit

Permalink
Merge branch 'master' of github.com:gwuhaolin/livego into features
Browse files Browse the repository at this point in the history
  • Loading branch information
GNURub committed Apr 10, 2020
2 parents d875076 + c04c62a commit ffc86e7
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 17 deletions.
1 change: 0 additions & 1 deletion Dockerfile
Expand Up @@ -12,7 +12,6 @@ ENV RTMP_PORT 1935
ENV HTTP_FLV_PORT 7001
ENV HLS_PORT 7002
ENV HTTP_OPERATION_PORT 8090
COPY --from=builder /app/config ./config
COPY --from=builder /app/livego .
EXPOSE ${RTMP_PORT}
EXPOSE ${HTTP_FLV_PORT}
Expand Down
7 changes: 5 additions & 2 deletions README.md
@@ -1,4 +1,7 @@
# livego
![Test](https://github.com/gwuhaolin/livego/workflows/Test/badge.svg)

<img src='./logo.png' width='130px' height='50px'/>

Simple and efficient live broadcast server:
- Very simple to install and use;
- Pure Golang, high performance, cross-platform;
Expand All @@ -23,7 +26,7 @@ Simple and efficient live broadcast server:
After directly downloading the compiled [binary file](https://github.com/gwuhaolin/livego/releases), execute it on the command line.

#### Boot from Docker
Run `docker run -p 1935:1935 -p 7001:7001 -p 7002:7002 -d --name livego gnurub/livego` to start
Run `docker run -p 1935:1935 -p 7001:7001 -p 7002:7002 -d --name livego gwuhaolin/livego` to start

#### Compile from source
1. Download the source code `git clone https://github.com/gwuhaolin/livego.git`
Expand Down
18 changes: 10 additions & 8 deletions configure/liveconfig.go
Expand Up @@ -41,28 +41,30 @@ type ServerCfg struct {
Server []Application `json:"server"`
}

var RtmpServercfg ServerCfg
// default config
var RtmpServercfg = ServerCfg{
Server: []Application{{
Appname: "livego",
Liveon: "on",
Hlson: "on",
StaticPush: nil,
}},
}

func LoadConfig(configfilename string) error {
func LoadConfig(configfilename string) {
log.Printf("starting load configure file %s", configfilename)
data, err := ioutil.ReadFile(configfilename)
if err != nil {
log.Printf("ReadFile %s error:%v", configfilename, err)
return err
}

// log.Printf("loadconfig: \r\n%s", string(data))

err = json.Unmarshal(data, &RtmpServercfg)
if err != nil {
log.Printf("json.Unmarshal error:%v", err)
return err
}
log.Printf("get config json data:%v", RtmpServercfg)

Init()

return nil
}

func GetRedisAddr() *string {
Expand Down
2 changes: 1 addition & 1 deletion config/livego.json → livego.json
@@ -1,7 +1,7 @@
{
"server": [
{
"appname": "live",
"appname": "livego",
"liveon": "on",
"hlson": "on"
}
Expand Down
Binary file added logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 2 additions & 5 deletions main.go
Expand Up @@ -19,7 +19,7 @@ var (
httpFlvAddr = flag.String("httpflv-addr", ":7001", "HTTP-FLV server listen address")
hlsAddr = flag.String("hls-addr", ":7002", "HLS server listen address")
operaAddr = flag.String("manage-addr", ":8090", "HTTP manage interface server listen address")
configfilename = flag.String("config-file", "config/livego.json", "configure filename")
configfilename = flag.String("config-file", "livego.json", "configure filename")
)

func init() {
Expand Down Expand Up @@ -116,10 +116,7 @@ func main() {
}
}()
log.Println("start livego, version", version)
err := configure.LoadConfig(*configfilename)
if err != nil {
return
}
configure.LoadConfig(*configfilename)

stream := rtmp.NewRtmpStream()
hlsServer := startHls()
Expand Down

0 comments on commit ffc86e7

Please sign in to comment.