1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-09-27 06:16:09 -04:00
v2fly/app/dns/dns.go
2017-01-06 15:32:36 +01:00

22 lines
371 B
Go

package dns
import (
"net"
"v2ray.com/core/app"
"v2ray.com/core/common/serial"
)
// A DnsCache is an internal cache of DNS resolutions.
type Server interface {
Get(domain string) []net.IP
}
func FromSpace(space app.Space) Server {
app := space.(app.AppGetter).GetApp(serial.GetMessageType((*Config)(nil)))
if app == nil {
return nil
}
return app.(Server)
}