diff --git a/main.go b/main.go index 6086fe4..e481841 100644 --- a/main.go +++ b/main.go @@ -30,15 +30,18 @@ func (p *PreviewConfig) ServeHTTP(w http.ResponseWriter, r *http.Request) { Streams.Range(func(streamPath string, stream *Stream) { s += fmt.Sprintf("%s [ %s ]
", streamPath, streamPath, stream.GetType()) }) - s+= "

pull stream on subscribe 订阅时才会触发拉流的流

" + s += "

pull stream on subscribe 订阅时才会触发拉流的流

" for name, p := range Plugins { if pullcfg, ok := p.Config.(config.PullConfig); ok { - if pullonsub := pullcfg.GetPullConfig().PullOnSub; pullonsub != nil { + pullconf := pullcfg.GetPullConfig() + pullconf.PullOnSubLocker.RLock() + if pullconf.PullOnSub != nil { s += fmt.Sprintf("

%s

", name) - for streamPath, url := range pullonsub { + for streamPath, url := range pullconf.PullOnSub { s += fmt.Sprintf("%s <-- %s
", streamPath, streamPath, url) } } + pullconf.PullOnSubLocker.RUnlock() } } w.Write([]byte(s))