Browse Source

Merge branch 'master' of github.com:gwuhaolin/livego into features

pull/88/head
Ruben Cid 5 years ago
parent
commit
ffc86e7611
  1. 1
      Dockerfile
  2. 7
      README.md
  3. 18
      configure/liveconfig.go
  4. 2
      livego.json
  5. BIN
      logo.png
  6. 7
      main.go

1
Dockerfile

@ -12,7 +12,6 @@ ENV RTMP_PORT 1935 @@ -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}

7
README.md

@ -1,4 +1,7 @@ @@ -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;
@ -23,7 +26,7 @@ Simple and efficient live broadcast server: @@ -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`

18
configure/liveconfig.go

@ -41,28 +41,30 @@ type ServerCfg struct { @@ -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 {

2
config/livego.json → livego.json

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
{
"server": [
{
"appname": "live",
"appname": "livego",
"liveon": "on",
"hlson": "on"
}

BIN
logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

7
main.go

@ -19,7 +19,7 @@ var ( @@ -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() {
@ -116,10 +116,7 @@ func main() { @@ -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()

Loading…
Cancel
Save