mirror of
https://github.com/Monibuca/plugin-rtsp.git
synced 2025-10-05 07:36:57 +08:00
默认拉tcp
This commit is contained in:
4
main.go
4
main.go
@@ -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)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user