github.com/eagleql/xray-core@v1.4.4/infra/conf/dns_proxy_test.go (about)

     1  package conf_test
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/eagleql/xray-core/common/net"
     7  	. "github.com/eagleql/xray-core/infra/conf"
     8  	"github.com/eagleql/xray-core/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  }