默认拉tcp

This commit is contained in:
dexter
2021-11-19 21:24:30 +08:00
parent 5094fd0db7
commit 4107d31c79
4 changed files with 19 additions and 13 deletions

View File

@@ -58,14 +58,14 @@ func runPlugin() {
CORS(w, r)
targetURL := r.URL.Query().Get("target")
streamPath := r.URL.Query().Get("streamPath")
if err := (&RTSPClient{}).PullStream(streamPath, targetURL); err == nil {
if err := (&RTSPClient{Transport: gortsplib.TransportTCP}).PullStream(streamPath, targetURL); err == nil {
w.Write([]byte(`{"code":0}`))
} else {
w.Write([]byte(fmt.Sprintf(`{"code":1,"msg":"%s"}`, err.Error())))
}
})
for streamPath, url := range config.AutoPullList {
if err := (&RTSPClient{}).PullStream(streamPath, url); err != nil {
if err := (&RTSPClient{Transport: gortsplib.TransportTCP}).PullStream(streamPath, url); err != nil {
Println(err)
}
}