Type Function Return value Userdata Revision Release 2022.3683 Keywords ZeroConf, network, publish See also zeroconf.unpublish() zeroconf.unpublishAll() zeroconf.*
Starts advertising a service over the network. This will also trigger a PluginZeroConfEvent event with a phase of "published"
.
If publishing is started successfully, a publish ID will be returned. This can be passed to zeroconf.unpublish() to
This function returns nil
in case of failure.
zeroconf.publish( params )
Table. Table containing parameters for the new object — see the next section for details.
Number. Network port number to be advertised.
String. The type of service to publish. This must start with an underscore (_
) and end with a protocol separated by a dot. Valid protocol names are _tcp
and _udp
. The default type is _corona._tcp
.
String. This should identify a specific device. Passing an empty string (default) will trigger an attempt to generate a unique name.
Table. Arbitrary key-value data can be attached to the published service. Both data keys and values must be a string. Total size of all attached data is limited to 255 bytes.
String. Domain to browse for services. Default is "local"
. An empty string indicates all available domains. Omit this key unless you fully understand its purpose.