dns.go 308 B

1234567891011121314151617181920
  1. package dns
  2. import (
  3. "net"
  4. "v2ray.com/core/app"
  5. )
  6. // A DnsCache is an internal cache of DNS resolutions.
  7. type Server interface {
  8. Get(domain string) []net.IP
  9. }
  10. func FromSpace(space app.Space) Server {
  11. app := space.GetApplication((*Server)(nil))
  12. if app == nil {
  13. return nil
  14. }
  15. return app.(Server)
  16. }