package mdns
Import Path
github.com/pion/mdns/v2 (on go.dev)
Dependency Relation
imports 11 packages, and imported by one package
Package-Level Type Names (total 2)
Config is used to configure a mDNS client or server.
IncludeLoopback will include loopback interfaces to be eligble for queries and answers.
Interfaces will override the interfaces used for queries and answers.
LocalAddress will override the published address with the given IP
when set. Otherwise, the automatically determined address will be used.
LocalNames are the names that we will generate answers for
when we get questions
LoggerFactory logging.LoggerFactory
Name is the name of the client/server used for logging purposes.
QueryInterval controls how often we sends Queries until we
get a response for the requested name
func Server(multicastPktConnV4 *ipv4.PacketConn, multicastPktConnV6 *ipv6.PacketConn, config *Config) (*Conn, error)
Conn represents a mDNS Server
Close closes the mDNS Conn
Query sends mDNS Queries for the following name until
either the Context is canceled/expires or we get a result
Deprecated: Use QueryAddr instead as it supports the easier to use netip.Addr.
QueryAddr sends mDNS Queries for the following name until
either the Context is canceled/expires or we get a result
*Conn : github.com/prometheus/common/expfmt.Closer
*Conn : io.Closer
func Server(multicastPktConnV4 *ipv4.PacketConn, multicastPktConnV6 *ipv6.PacketConn, config *Config) (*Conn, error)
Package-Level Functions (only one)
Server establishes a mDNS connection over an existing conn.
Either one or both of the multicast packet conns should be provided.
The presence of each IP type of PacketConn will dictate what kinds
of questions are sent for queries. That is, if an ipv6.PacketConn is
provided, then AAAA questions will be sent. A questions will only be
sent if an ipv4.PacketConn is also provided. In the future, we may
add a QueryAddr method that allows specifying this more clearly.
Package-Level Constants (total 2)
DefaultAddressIPv4 is the default used by mDNS
and in most cases should be the address that the
ipv4.PacketConn passed to Server is bound to
DefaultAddressIPv6 is the default IPv6 address used
by mDNS and in most cases should be the address that
the ipv6.PacketConn passed to Server is bound to
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |