mirror of
https://gitlab.crans.org/nounous/ghostream.git
synced 2025-06-29 11:00:55 +02:00
Display SRT url on web page
This commit is contained in:
9
main.go
9
main.go
@ -4,6 +4,7 @@ package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"net"
|
||||
"strings"
|
||||
|
||||
"github.com/spf13/viper"
|
||||
@ -66,6 +67,14 @@ func loadConfiguration() {
|
||||
|
||||
// Copy STUN configuration to clients
|
||||
viper.Set("Web.STUNServers", viper.Get("WebRTC.STUNServers"))
|
||||
|
||||
// Copy SRT server port to display it on web page
|
||||
hostport := viper.GetString("Srt.ListenAddress")
|
||||
_, srtPort, err := net.SplitHostPort(hostport)
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to split host and port from %s", hostport)
|
||||
}
|
||||
viper.Set("Web.SRTServerPort", srtPort)
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
Reference in New Issue
Block a user