gluamdns

package module
v0.0.0-...-0d6bed7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2025 License: MIT Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

gluamdns

This is a lua module for mdns service discovery.

Usage

local mdns = require("mdns")

-- Browse for services on the local network
-- Parameters:
--   1. service type (e.g. "_workstation._tcp")
--   2. domain (typically "local")
--   3. timeout in seconds
local results = mdns.browse("_workstation._tcp", "local", 2)

-- Results is a table of entries, each containing:
--   - name: service name
--   - service: service type
--   - domain: domain name
--   - port: port number
--   - ips: table of IP addresses
--   - serviceInstanceName: full service instance name
--   - serviceTypeName: full service type name

for _, entry in ipairs(results) do
    print("Found service:", entry.name)
    print("Port:", entry.port)
    print("IPs:", table.concat(entry.ips, ", "))
end

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Loader

func Loader(L *lua.LState) int

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址