mirror of
https://github.com/langhuihui/monibuca.git
synced 2025-09-27 03:25:56 +08:00
feat: add pullproxy support gb28181 type
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"net"
|
||||
"net/url"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -287,6 +288,12 @@ func (s *Server) AddPullProxy(ctx context.Context, req *pb.PullProxyInfo) (res *
|
||||
pullProxyConfig.Type = "flv"
|
||||
case ".mp4":
|
||||
pullProxyConfig.Type = "mp4"
|
||||
default:
|
||||
pattern := `^\d{20}/\d{20}$`
|
||||
re := regexp.MustCompile(pattern)
|
||||
if re.MatchString(u.Path) {
|
||||
pullProxyConfig.Type = "gb28181"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -489,4 +496,4 @@ func (p *PullProxyManager) CheckToPull(streamPath string) {
|
||||
pullProxy.Pull()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user