Xray-core/infra/conf/dns_proxy_test.go

35 lines
638 B
Go
Raw Normal View History

2020-11-25 14:01:53 +03:00
package conf_test
import (
"testing"
2020-12-04 04:36:16 +03:00
"github.com/xtls/xray-core/common/net"
. "github.com/xtls/xray-core/infra/conf"
"github.com/xtls/xray-core/proxy/dns"
2020-11-25 14:01:53 +03:00
)
func TestDnsProxyConfig(t *testing.T) {
creator := func() Buildable {
return new(DNSOutboundConfig)
}
runMultiTestCase(t, []TestCase{
{
Input: `{
"address": "8.8.8.8",
"port": 53,
"network": "tcp"
}`,
Parser: loadJSON(creator),
Output: &dns.Config{
Server: &net.Endpoint{
Network: net.Network_TCP,
Address: net.NewIPOrDomain(net.IPAddress([]byte{8, 8, 8, 8})),
Port: 53,
},
2023-06-19 03:51:03 +03:00
Non_IPQuery: "drop",
2020-11-25 14:01:53 +03:00
},
},
})
}