Documentation ¶
Overview ¶
Package server provides an MDNS server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( MDNSGroupIPv4 = net.ParseIP("224.0.0.251") MDNSGroupIPv6 = net.ParseIP("ff02::fb") )
mDNS Groups.
View Source
var ( MDNSWildcardAddrIPv4 = &net.UDPAddr{ IP: net.ParseIP("224.0.0.0"), Port: 5353, } MDNSWildcardAddrIPv6 = &net.UDPAddr{ IP: net.ParseIP("ff02::"), Port: 5353, } )
mDNS wildcard addresses.
View Source
var ( IPv4Addr = &net.UDPAddr{ IP: MDNSGroupIPv4, Port: 5353, } IPv6Addr = &net.UDPAddr{ IP: MDNSGroupIPv6, Port: 5353, } )
mDNS endpoint addresses.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Zone must be provided to support responding to queries Zone zone.Zone // Iface if provided binds the multicast listener to the given // interface. If not provided, the system default multicase interface // is used. Iface *net.Interface // Port If it is not 0, replace the port 5353 with this port number. Port int // GetMachineIP is a function to return the IP of the local machine GetMachineIP GetMachineIP // LocalhostChecking if enabled asks the server to also send responses to // 0.0.0.0 if the target IP // is this host (as defined by GetMachineIP). // Useful in case machine is on a VPN which blocks comms on non standard ports LocalhostChecking bool }
Config is used to configure the mDNS server.
type GetMachineIP ¶
GetMachineIP is a func which returns the outbound IP of this machine. Used by the server to determine whether to attempt send the response on a local address.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is an mDNS server used to listen for mDNS queries and respond if we have a matching local record.
func (*Server) SendMulticast ¶
SendMulticast us used to send a multicast response packet.
Click to show internal directories.
Click to hide internal directories.