github.com/v2fly/v2ray-core/v4@v4.45.2/infra/conf/dns_proxy_test.go (about) 1 package conf_test 2 3 import ( 4 "testing" 5 6 "github.com/v2fly/v2ray-core/v4/common/net" 7 . "github.com/v2fly/v2ray-core/v4/infra/conf" 8 "github.com/v2fly/v2ray-core/v4/proxy/dns" 9 ) 10 11 func TestDnsProxyConfig(t *testing.T) { 12 creator := func() Buildable { 13 return new(DNSOutboundConfig) 14 } 15 16 runMultiTestCase(t, []TestCase{ 17 { 18 Input: `{ 19 "address": "8.8.8.8", 20 "port": 53, 21 "network": "tcp" 22 }`, 23 Parser: loadJSON(creator), 24 Output: &dns.Config{ 25 Server: &net.Endpoint{ 26 Network: net.Network_TCP, 27 Address: net.NewIPOrDomain(net.IPAddress([]byte{8, 8, 8, 8})), 28 Port: 53, 29 }, 30 }, 31 }, 32 }) 33 }