mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-22 01:57:12 -05:00
c78ee5aac7
* ⬆ Update to Go 1.17 * 🏗 Update workflows and add windows-arm64 * 💾 Update generated files * 📛 Update not-so-friendly filenames
34 lines
656 B
Go
34 lines
656 B
Go
//go:build android
|
|
// +build android
|
|
|
|
package internet
|
|
|
|
import (
|
|
"context"
|
|
"net"
|
|
)
|
|
|
|
const SystemDNS = "8.8.8.8:53"
|
|
|
|
/* DNSResolverFunc
|
|
This is a temporary API and is subject to removal at any time.
|
|
*/
|
|
type DNSResolverFunc func() *net.Resolver
|
|
|
|
/* NewDNSResolver
|
|
This is a temporary API and is subject to removal at any time.
|
|
*/
|
|
var NewDNSResolver DNSResolverFunc = func() *net.Resolver {
|
|
return &net.Resolver{
|
|
PreferGo: true,
|
|
Dial: func(ctx context.Context, network, _ string) (net.Conn, error) {
|
|
var dialer net.Dialer
|
|
return dialer.DialContext(ctx, network, SystemDNS)
|
|
},
|
|
}
|
|
}
|
|
|
|
func init() {
|
|
net.DefaultResolver = NewDNSResolver()
|
|
}
|