mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-30 01:08:33 +00:00
Add Fake DNS support (#309)
Co-authored-by: Xiaokang Wang <xiaokangwang@outlook.com> Co-authored-by: loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com> Co-authored-by: kslr <kslrwang@gmail.com>
This commit is contained in:
parent
db32ce6fd9
commit
f50eff5ebb
43 changed files with 1351 additions and 301 deletions
|
@ -8,6 +8,7 @@ import (
|
|||
. "github.com/xtls/xray-core/app/dns"
|
||||
"github.com/xtls/xray-core/common"
|
||||
"github.com/xtls/xray-core/common/net"
|
||||
"github.com/xtls/xray-core/features/dns"
|
||||
)
|
||||
|
||||
func TestStaticHosts(t *testing.T) {
|
||||
|
@ -39,7 +40,7 @@ func TestStaticHosts(t *testing.T) {
|
|||
common.Must(err)
|
||||
|
||||
{
|
||||
ips := hosts.LookupIP("example.com", IPOption{
|
||||
ips := hosts.LookupIP("example.com", dns.IPOption{
|
||||
IPv4Enable: true,
|
||||
IPv6Enable: true,
|
||||
})
|
||||
|
@ -52,7 +53,7 @@ func TestStaticHosts(t *testing.T) {
|
|||
}
|
||||
|
||||
{
|
||||
ips := hosts.LookupIP("www.example.cn", IPOption{
|
||||
ips := hosts.LookupIP("www.example.cn", dns.IPOption{
|
||||
IPv4Enable: true,
|
||||
IPv6Enable: true,
|
||||
})
|
||||
|
@ -65,7 +66,7 @@ func TestStaticHosts(t *testing.T) {
|
|||
}
|
||||
|
||||
{
|
||||
ips := hosts.LookupIP("baidu.com", IPOption{
|
||||
ips := hosts.LookupIP("baidu.com", dns.IPOption{
|
||||
IPv4Enable: false,
|
||||
IPv6Enable: true,
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue