mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-12-22 11:23:32 +02:00
adjust
This commit is contained in:
parent
a229a7f85e
commit
500c6de359
2 changed files with 10 additions and 10 deletions
|
@ -21,17 +21,17 @@ func TestStaticHosts(t *testing.T) {
|
|||
},
|
||||
{
|
||||
Type: DomainMatchingType_Full,
|
||||
Domain: "proxy.v2fly.org",
|
||||
Domain: "proxy.xray.com",
|
||||
Ip: [][]byte{
|
||||
{1, 2, 3, 4},
|
||||
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},
|
||||
},
|
||||
ProxiedDomain: "another-proxy.v2fly.org",
|
||||
ProxiedDomain: "another-proxy.xray.com",
|
||||
},
|
||||
{
|
||||
Type: DomainMatchingType_Full,
|
||||
Domain: "proxy2.v2fly.org",
|
||||
ProxiedDomain: "proxy.v2fly.org",
|
||||
Domain: "proxy2.xray.com",
|
||||
ProxiedDomain: "proxy.xray.com",
|
||||
},
|
||||
{
|
||||
Type: DomainMatchingType_Subdomain,
|
||||
|
@ -67,27 +67,27 @@ func TestStaticHosts(t *testing.T) {
|
|||
}
|
||||
|
||||
{
|
||||
domain := hosts.Lookup("proxy.v2fly.org", dns.IPOption{
|
||||
domain := hosts.Lookup("proxy.xray.com", dns.IPOption{
|
||||
IPv4Enable: true,
|
||||
IPv6Enable: false,
|
||||
})
|
||||
if len(domain) != 1 {
|
||||
t.Error("expect 1 domain, but got ", len(domain))
|
||||
}
|
||||
if diff := cmp.Diff(domain[0].Domain(), "another-proxy.v2fly.org"); diff != "" {
|
||||
if diff := cmp.Diff(domain[0].Domain(), "another-proxy.xray.com"); diff != "" {
|
||||
t.Error(diff)
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
domain := hosts.Lookup("proxy2.v2fly.org", dns.IPOption{
|
||||
domain := hosts.Lookup("proxy2.xray.com", dns.IPOption{
|
||||
IPv4Enable: true,
|
||||
IPv6Enable: false,
|
||||
})
|
||||
if len(domain) != 1 {
|
||||
t.Error("expect 1 domain, but got ", len(domain))
|
||||
}
|
||||
if diff := cmp.Diff(domain[0].Domain(), "another-proxy.v2fly.org"); diff != "" {
|
||||
if diff := cmp.Diff(domain[0].Domain(), "another-proxy.xray.com"); diff != "" {
|
||||
t.Error(diff)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,13 +11,13 @@ import (
|
|||
func BenchmarkACAutomaton(b *testing.B) {
|
||||
ac := NewACAutomaton()
|
||||
for i := 1; i <= 1024; i++ {
|
||||
ac.Add(strconv.Itoa(i)+".v2ray.com", Domain)
|
||||
ac.Add(strconv.Itoa(i)+".xray.com", Domain)
|
||||
}
|
||||
ac.Build()
|
||||
|
||||
b.ResetTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
_ = ac.Match("0.v2ray.com")
|
||||
_ = ac.Match("0.xray.com")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue