Represents the service records that are discovered or published by the hs.bonjour module.
This module allows you to explore the details of discovered services including ip addresses and text records, and to publish your own multicast DNS advertisements for services on your computer. This can be useful to advertise network services provided by other Hammerspoon modules or other applications on your computer which do not publish their own advertisements already.
This module will not allow you to publish proxy records for other hosts on your local network. Additional submodules which may address this limitation as well as provide additional functions available with Apple's dns-sd library are being considered but there is no estimated timeframe at present.
Signature | hs.bonjour.serviceTypes |
---|---|
Type | Constant |
Description | A list of common service types which can used for discovery through this module. |
Notes |
|
Source | extensions/bonjour/bonjour.lua line 248 |
Signature | hs.bonjour.service.new(name, service, port, [domain]) -> serviceObject |
---|---|
Type | Constructor |
Description | Returns a new serviceObject for advertising a service provided by your computer. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/bonjour/bonjour.lua line 108 |
Signature | hs.bonjour.service.remote(name, service, [domain]) -> serviceObject |
---|---|
Type | Constructor |
Description | Returns a new serviceObject for a remote machine (i.e. not the users computer) on your network offering the specified service. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/bonjour/bonjour.lua line 138 |
Signature | hs.bonjour.service:addresses() -> table |
---|---|
Type | Method |
Description | Returns a table listing the addresses for the service represented by the serviceObject |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/bonjour/libbonjour_service.m line 213 |
Signature | hs.bonjour.service:domain() -> string |
---|---|
Type | Method |
Description | Returns the domain the service represented by the serviceObject belongs to. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/bonjour/libbonjour_service.m line 248 |
Signature | hs.bonjour.service:hostname() -> string |
---|---|
Type | Method |
Description | Returns the hostname of the machine the service represented by the serviceObject belongs to. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/bonjour/libbonjour_service.m line 286 |
Signature | hs.bonjour.service:includesPeerToPeer([value]) -> boolean | serviceObject |
---|---|
Type | Method |
Description | Get or set whether the service represented by the service object should be published or resolved over peer-to-peer Bluetooth and Wi-Fi, if available. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/bonjour/libbonjour_service.m line 400 |
Signature | hs.bonjour.service:monitor([callback]) -> serviceObject |
---|---|
Type | Method |
Description | Monitor the service for changes to its associated text records. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/bonjour/libbonjour_service.m line 552 |
Signature | hs.bonjour.service:name() -> string |
---|---|
Type | Method |
Description | Returns the name of the service represented by the serviceObject. |
Parameters |
|
Returns |
|
Source | extensions/bonjour/libbonjour_service.m line 269 |
Signature | hs.bonjour.service:port() -> integer |
---|---|
Type | Method |
Description | Returns the port the service represented by the serviceObject is available on. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/bonjour/libbonjour_service.m line 324 |
Signature | hs.bonjour.service:publish([allowRename], [callback]) -> serviceObject |
---|---|
Type | Method |
Description | Begin advertising the specified local service. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/bonjour/libbonjour_service.m line 430 |
Signature | hs.bonjour.service:resolve([timeout], [callback]) -> serviceObject |
---|---|
Type | Method |
Description | Resolve the address and details for a discovered service. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/bonjour/libbonjour_service.m line 486 |
Signature | hs.bonjour.service:stop() -> serviceObject |
---|---|
Type | Method |
Description | Stop advertising or resolving the service specified by the serviceObject |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/bonjour/libbonjour_service.m line 588 |
Signature | hs.bonjour.service:stopMonitoring() -> serviceObject |
---|---|
Type | Method |
Description | Stop monitoring a service for changes to its text records. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/bonjour/libbonjour_service.m line 612 |
Signature | hs.bonjour.service:txtRecord([records]) -> table | serviceObject | false |
---|---|
Type | Method |
Description | Get or set the text records associated with the serviceObject. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/bonjour/libbonjour_service.m line 345 |
Signature | hs.bonjour.service:type() -> string |
---|---|
Type | Method |
Description | Returns the type of service represented by the serviceObject. |
Parameters |
|
Returns |
|
Source | extensions/bonjour/libbonjour_service.m line 307 |