mirror of
https://github.com/Monibuca/plugin-rtmp.git
synced 2025-10-05 07:27:14 +08:00
27 lines
449 B
Go
27 lines
449 B
Go
package rtmp
|
|
|
|
import (
|
|
"log"
|
|
|
|
"github.com/Monibuca/engine/v3"
|
|
. "github.com/Monibuca/utils/v3"
|
|
. "github.com/logrusorgru/aurora"
|
|
)
|
|
|
|
var config = struct {
|
|
ListenAddr string
|
|
ChunkSize int
|
|
}{":1935", 512}
|
|
|
|
func init() {
|
|
pc := engine.PluginConfig{
|
|
Name: "RTMP",
|
|
Config: &config,
|
|
}
|
|
pc.Install(run)
|
|
}
|
|
func run() {
|
|
Print(Green("server rtmp start at"), BrightBlue(config.ListenAddr))
|
|
log.Fatal(ListenTCP(config.ListenAddr, processRtmp))
|
|
}
|