1
0
mirror of https://gitlab.crans.org/nounous/ghostream.git synced 2025-06-29 07:30:54 +02:00

Fix #7: make each module optional

This commit is contained in:
Alexandre Iooss
2020-10-09 22:06:30 +02:00
parent 99bfc5e109
commit 45c6b5dba5
9 changed files with 64 additions and 45 deletions

View File

@ -19,6 +19,7 @@ var (
// Options holds web package configuration
type Options struct {
Enabled bool
ListenAddress string
MaxClients int
}
@ -53,6 +54,11 @@ func GetNumberConnectedSessions(streamID string) int {
// Serve SRT server
func Serve(cfg *Options, authBackend auth.Backend, forwardingChannel, webrtcChannel chan Packet) {
if !cfg.Enabled {
// SRT is not enabled, ignore
return
}
// Start SRT in listening mode
log.Printf("SRT server listening on %s", cfg.ListenAddress)
host, port := splitHostPort(cfg.ListenAddress)