新增TLS端口监听和服用网关端口功能

This commit is contained in:
langhuihui
2021-01-09 18:04:59 +08:00
parent b568fb038a
commit 2a3b608076
5 changed files with 67 additions and 14 deletions

23
main_test.go Normal file
View File

@@ -0,0 +1,23 @@
package hdl
import (
"testing"
)
func TestHDLHandler(t *testing.T) {
tests := map[string]string{
"/hdl/abc.flv": "abc", "/hdl/abc": "abc", "/abc": "abc", "/abc.flv": "abc",
}
for name, result := range tests {
t.Run(name, func(t *testing.T) {
parts := streamPathReg.FindStringSubmatch(name)
stringPath := parts[3]
if stringPath == "" {
stringPath = parts[5]
}
if stringPath != result {
t.Fail()
}
})
}
}