16.12.2021, 07:14
Use this, change _http._tcp to the required service name.
Code:
avahi = io.readproc('avahi-browse _http._tcp')
lines = avahi:split('\n')
for _, line in ipairs(lines) do
ip, port, name, descr = unpack(line:split('\t'))
if descr then
log(ip, port, name, descr)
end
end