1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-04-10 07:45:54 -04:00

proto for dns config

This commit is contained in:
Darien Raymond
2016-09-20 16:05:35 +02:00
parent 7de7588ec2
commit d38e62932d
10 changed files with 163 additions and 34 deletions

View File

@@ -1,7 +1,6 @@
package freedom_test
import (
"net"
"testing"
"v2ray.com/core/app"
@@ -90,8 +89,12 @@ func TestIPResolution(t *testing.T) {
r, _ := router.CreateRouter("rules", &rules.RouterRuleConfig{}, space)
space.BindApp(router.APP_ID, r)
dnsServer := dns.NewCacheServer(space, &dns.Config{
Hosts: map[string]net.IP{
"v2ray.com": net.IP([]byte{127, 0, 0, 1}),
Hosts: map[string]*v2net.AddressPB{
"v2ray.com": &v2net.AddressPB{
Address: &v2net.AddressPB_Ip{
Ip: []byte{127, 0, 0, 1},
},
},
},
})
space.BindApp(dns.APP_ID, dnsServer)