zeroconf icon indicating copy to clipboard operation
zeroconf copied to clipboard

localhost only

Open pkpowell opened this issue 2 years ago • 1 comments

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)

pkpowell avatar Apr 13 '22 06:04 pkpowell

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)

pkpowell avatar May 16 '22 09:05 pkpowell