Browse Source

JWT middelware

pull/86/head
Ruben Cid 5 years ago
parent
commit
8b2b7d3e85
  1. 4
      .livego.json
  2. 27
      CHANGELOG.md
  3. 64
      README.md
  4. 1
      go.sum

4
.livego.json

@ -1,8 +1,4 @@ @@ -1,8 +1,4 @@
{
"jwt": {
"secret": "testing",
"algorithm": "HS256s"
},
"server": [
{
"appname": "live",

27
CHANGELOG.md

@ -0,0 +1,27 @@ @@ -0,0 +1,27 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
## [1.0.0] - 2020-04-08
### Added
- JSON Web Token support.
``` json
// .livego.json
{
"jwt": {
"secret": "testing",
"algorithm": "HS256s"
},
"server": [
{
"appname": "live",
"liveon": "on",
"hlson": "on"
}
]
}
```

64
README.md

@ -1,43 +1,43 @@ @@ -1,43 +1,43 @@
# livego
简单高效的直播服务器:
- 安装和使用非常简单;
- 纯 Golang 编写,性能高,跨平台;
- 支持常用的传输协议、文件格式、编码格式;
Simple and efficient live broadcast server:
-Very simple to install and use;
-Pure Golang, high performance, cross-platform;
-Support commonly used transmission protocols, file formats, encoding formats;
#### 支持的传输协议
- RTMP
- AMF
- HLS
- HTTP-FLV
#### Supported transport protocols
-RTMP
-AMF
-HLS
-HTTP-FLV
#### 支持的容器格式
- FLV
- TS
#### Supported container formats
-FLV
-TS
#### 支持的编码格式
- H264
- AAC
- MP3
#### Supported encoding formats
-H264
-AAC
-MP3
## 安装
直接下载编译好的[二进制文件](https://github.com/gwuhaolin/livego/releases)后,在命令行中执行。
## Installation
After directly downloading the compiled [binary file] (https://github.com/gwuhaolin/livego/releases), execute it on the command line.
#### 从 Docker 启动
执行`docker run -p 1935:1935 -p 7001:7001 -p 7002:7002 -d --name livego gwuhaolin/livego`启动
#### Boot from Docker
Run `docker run -p 1935: 1935 -p 7001: 7001 -p 7002: 7002 -d --name livego gwuhaolin / livego` to start
#### 从源码编译
1. 下载源码 `git clone https://github.com/gwuhaolin/livego.git`
2. 去 livego 目录中 执行 `go build`
#### Compile from source
1. Download the source code `git clone https: // github.com / gwuhaolin / livego.git`
2. Go to the livego directory and execute `go build`
## 使用
2. 启动服务:执行 `livego` 二进制文件启动 livego 服务;
3. 上行推流:通过 `RTMP` 协议把视频流推送到 `rtmp://localhost:1935/live/movie`,例如使用 `ffmpeg -re -i demo.flv -c copy -f flv rtmp://localhost:1935/live/movie` 推送;
4. 下行播放:支持以下三种播放协议,播放地址如下:
- `RTMP`:`rtmp://localhost:1935/live/movie`
- `FLV`:`http://127.0.0.1:7001/live/movie.flv`
- `HLS`:`http://127.0.0.1:7002/live/movie.m3u8`
## Use
2. Start the service: execute the livego binary file to start the livego service;
3. Upstream push: Push the video stream to `rtmp: // localhost: 1935 / live / movie` through the` RTMP` protocol, for example, use `ffmpeg -re -i demo.flv -c copy -f flv rtmp: / / localhost: 1935 / live / movie` push;
4. Downstream playback: The following three playback protocols are supported, and the playback address is as follows:
-`RTMP`:` rtmp: // localhost: 1935 / live / movie`
-`FLV`:` http: //127.0.0.1: 7001 / live / movie.flv`
-`HLS`:` http: //127.0.0.1: 7002 / live / movie.m3u8`
### [和 flv.js 搭配使用](https://github.com/gwuhaolin/blog/issues/3)
### [Use with flv.js] (https://github.com/gwuhaolin/blog/issues/3)
对Golang感兴趣?请看[Golang 中文学习资料汇总](http://go.wuhaolin.cn/)
Interested in Golang? Please see [Golang Chinese Learning Materials Summary] (http://go.wuhaolin.cn/)

1
go.sum

@ -4,6 +4,7 @@ github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8 @@ -4,6 +4,7 @@ github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gorilla/mux v1.7.4 h1:VuZ8uybHlWmqV03+zRzdwKL4tUnIp1MAQtp1mIFE1bc=
github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=

Loading…
Cancel
Save