config.go 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
  2. // SPDX-License-Identifier: MIT
  3. package mdns
  4. import (
  5. "net"
  6. "time"
  7. "github.com/pion/logging"
  8. )
  9. const (
  10. // DefaultAddress is the default used by mDNS
  11. // and in most cases should be the address that the
  12. // net.Conn passed to Server is bound to
  13. DefaultAddress = "224.0.0.0:5353"
  14. )
  15. // Config is used to configure a mDNS client or server.
  16. type Config struct {
  17. // QueryInterval controls how often we sends Queries until we
  18. // get a response for the requested name
  19. QueryInterval time.Duration
  20. // LocalNames are the names that we will generate answers for
  21. // when we get questions
  22. LocalNames []string
  23. // LocalAddress will override the published address with the given IP
  24. // when set. Otherwise, the automatically determined address will be used.
  25. LocalAddress net.IP
  26. LoggerFactory logging.LoggerFactory
  27. // IncludeLoopback will include loopback interfaces to be eligble for queries and answers.
  28. IncludeLoopback bool
  29. // Interfaces will override the interfaces used for queries and answers.
  30. Interfaces []net.Interface
  31. }