zeroconf
zeroconf copied to clipboard
localhost only
Is it possible to only publish on localhost and not lan-wide, i.e. the equivalent of dns-sd -lo -P...
?
Use case is to prevent vpn addresses used by some clients from leaking onto the lan.
dns-sd -lo (Run dns-sd cmd using local only interface)
The following works (assuming index: 1
is always the loopback interface).
interfaces = []net.Interface{
net.Interface{
Index: 1,
},
}
zeroconf.RegisterProxy(*name, *service, *domain, *port, *host, []string{*ip}, []string{"txtv=0", "lo=1", "la=2"}, interfaces)