2021-01-02 02:48:13 -05:00
|
|
|
// +build android
|
|
|
|
|
|
|
|
package conf
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"net"
|
|
|
|
)
|
|
|
|
|
2021-03-10 08:23:15 -05:00
|
|
|
func init() {
|
|
|
|
const bootstrapDNS = "8.8.8.8:53"
|
2021-01-02 02:48:13 -05:00
|
|
|
var dialer net.Dialer
|
|
|
|
net.DefaultResolver = &net.Resolver{
|
2021-03-10 08:23:15 -05:00
|
|
|
PreferGo: true,
|
2021-01-02 02:48:13 -05:00
|
|
|
Dial: func(context context.Context, _, _ string) (net.Conn, error) {
|
|
|
|
conn, err := dialer.DialContext(context, "udp", bootstrapDNS)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return conn, nil
|
|
|
|
},
|
|
|
|
}
|
2021-03-10 08:23:15 -05:00
|
|
|
newError("Bootstrap DNS: ", bootstrapDNS).AtWarning().WriteToLog()
|
2021-01-02 02:48:13 -05:00
|
|
|
}
|