A signaling server for GB28181

This commit is contained in:
Haibo Chen
2024-04-17 14:31:33 +08:00
committed by chenhaibo
parent 8774b234b4
commit 0b7126b12b
50 changed files with 11136 additions and 1 deletions

30
tools/main.go Normal file
View File

@ -0,0 +1,30 @@
package main
import (
"context"
"os"
"os/signal"
"syscall"
"github.com/ossrs/go-oryx-lib/logger"
"github.com/ossrs/srs-bench/gb28181"
)
func main() {
ctx := context.Background()
var conf interface{}
conf = gb28181.Parse(ctx)
ctx, cancel := context.WithCancel(ctx)
go func() {
sigs := make(chan os.Signal, 1)
signal.Notify(sigs, syscall.SIGTERM, syscall.SIGINT)
for sig := range sigs {
logger.Wf(ctx, "Quit for signal %v", sig)
cancel()
}
}()
gb28181.Run(ctx, conf)
}