提升通过域名查找服务的性能,轻松支持海量域名

This commit is contained in:
刘祥超
2021-11-15 16:56:31 +08:00
parent a95fe17ebc
commit f4edd45886
6 changed files with 310 additions and 26 deletions

View File

@@ -72,3 +72,22 @@ func TestServerConfig_Protocols(t *testing.T) {
t.Log(server.FullAddresses())
}
}
func TestServerConfig_AllStrictNames(t *testing.T) {
var config = &ServerConfig{
AliasServerNames: []string{"hello.com", ".hello.com"},
ServerNames: []*ServerNameConfig{
{
Name: "hello2.com",
},
{
SubNames: []string{"hello3.com", "hello4.com", "*.hello5.com"},
},
{
Name: "~hello.com",
},
},
}
t.Log(config.AllStrictNames())
t.Log(config.AllFuzzyNames())
}