The CiaoService class represents a service which can be advertised on the network.
A service is identified by it's fully qualified domain name (FQDN), which consist of
the service name, the service type, the protocol and the service domain (.local by default).
@@ -8,7 +8,7 @@
A CiaoService class is always bound to a Responder and can be created using the
Responder.createService method in the Responder class.
Once the instance is created, advertise can be called to announce the service on the network.
This method start the advertising process of the service:
The service name (and hostname) will be probed unique on all interfaces (as defined in RFC 6762 8.1).
@@ -21,28 +21,28 @@
Prober could not find a unique service name while trying for a minute (timeout)
One of the announcement packets could not be sent successfully
-
Returns Promise<void>
destroy
destroy(): Promise<void>
+
Returns Promise<void>
destroy
destroy(): Promise<void>
This method must be called if you want to free the memory used by this service.
The service instance is not usable anymore after this call.
If the service is still announced, the service will first be removed
from the network by calling end.
-
Returns Promise<void>
end
end(): Promise<void>
+
Returns Promise<void>
end
end(): Promise<void>
This method will remove the advertisement for the service on all connected network interfaces.
If the service is still in the Probing state, probing will simply be cancelled.
Returns Promise<void>
Promise will resolve once the last goodbye packet was sent out
-
getFQDN
getFQDN(): string
Returns string
The fully qualified domain name of the service, used to identify the service.
-
getHostname
getHostname(): string
Returns string
The current hostname of the service.
-
getLowerCasedSubtypePTRs
getLowerCasedSubtypePTRs(): undefined | string[]
Returns undefined | string[]
Array of subtype pointers (undefined if no subtypes are specified).
-
getPort
getPort(): number
Returns number
The port the service is advertising for.
+
getFQDN
getFQDN(): string
Returns string
The fully qualified domain name of the service, used to identify the service.
+
getHostname
getHostname(): string
Returns string
The current hostname of the service.
+
getLowerCasedSubtypePTRs
getLowerCasedSubtypePTRs(): undefined | string[]
Returns undefined | string[]
Array of subtype pointers (undefined if no subtypes are specified).
+
getPort
getPort(): number
Returns number
The port the service is advertising for.
{@code -1} is returned when the port is not yet set.
-
getTypePTR
getTypePTR(): string
Returns string
The service type pointer.
-
updatePort
updatePort(port: number): void
+
getTypePTR
getTypePTR(): string
Returns string
The service type pointer.
+
updatePort
updatePort(port: number): void
Sets or updates the port of the service.
A new port number can only be set when the service is still UNANNOUNCED.
Otherwise an assertion error will be thrown.
A Responder instance represents a running MDNSServer and a set of advertised services.
It will handle any service related operations, like advertising, sending goodbye packets or sending record updates.
It handles answering questions arriving on the multicast address.
This method should be called when you want to unpublish all service exposed by this Responder.
This method SHOULD be called before the node application exists, so any host on the
network is informed of the shutdown of this machine.
diff --git a/docs/enums/protocol.html b/docs/enums/protocol.html
index 776df4c..ab78fdf 100644
--- a/docs/enums/protocol.html
+++ b/docs/enums/protocol.html
@@ -1,6 +1,6 @@
-
As of RFC 6763 7. TCP must be used for any applications using tcp.
For applications using any other transport protocol UDP must be used.
This applies to all other transport protocols like SCTP, DCCP, RTMFP, etc
Event is called when the Prober identifies that the hostname for the service is already used
and thus resolve the name conflict by adjusting the hostname (e.g. adding '(2)' to the hostname).
The name change must be persisted. As the hostname is an optional parameter, it is derived
from the service name if not supplied.
If you supply a custom hostname (not automatically derived from the service name) you must
hook up a listener to this event in order for the hostname to be persisted.
-
NAME_CHANGED
NAME_CHANGED = "name-change"
+
NAME_CHANGED
NAME_CHANGED = "name-change"
Event is called when the Prober identifies that the name for the service is already used
and thus resolve the name conflict by adjusting the name (e.g. adding '(2)' to the name).
This change must be persisted and thus a listener must hook up to this event
diff --git a/docs/enums/servicetype.html b/docs/enums/servicetype.html
index 13e4542..79ce4d1 100644
--- a/docs/enums/servicetype.html
+++ b/docs/enums/servicetype.html
@@ -1,5 +1,5 @@
-
This enum defines some commonly used service types.
This is also referred to as service name (as of RFC 6763).
A service name must not be longer than 15 characters (RFC 6763 7.2).
\ No newline at end of file
diff --git a/docs/index.html b/docs/index.html
index 34432b6..52178ef 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -1,11 +1,11 @@
-@homebridge/ciao - v1.1.3
If specified, the mdns server will not include any ipv6 address records
and not bind any udp6 sockets.
This is handy if you want to "bind" on 0.0.0.0 only.
-
Optional interface
interface?:string | string[]
+
Optional interface
interface?:string | string[]
If specified, the mdns server will only listen on the specified interfaces (allowlist).
It can be supplied as a string (representing a single interface) or as an array of strings
to define multiple interfaces.
diff --git a/docs/interfaces/serviceoptions.html b/docs/interfaces/serviceoptions.html
index 520bd2b..f0ec671 100644
--- a/docs/interfaces/serviceoptions.html
+++ b/docs/interfaces/serviceoptions.html
@@ -1,24 +1,24 @@
-
The service won't advertise ipv6 address records.
This can be used to simulate binding on 0.0.0.0.
May be combined with restrictedAddresses.
-
Optional domain
domain?:string
+
Optional domain
domain?:string
Adds ability to set custom domain. Will default to "local".
The domain will also be automatically appended to the hostname.
-
Optional hostname
hostname?:string
+
Optional hostname
hostname?:string
Defines a hostname under which the service can be reached.
The specified hostname must not include the TLD.
If undefined the service name will be used as default.
-
name
name:string
+
name
name:string
Instance name of the service
-
Optional port
port?:number
+
Optional port
port?:number
Port of the service.
If not supplied it must be set later via updatePort BEFORE advertising the service.
If defined it restricts the service to be advertised on the specified
ip addresses or interface names.
If a interface name is specified, ANY address on that given interface will be advertised
@@ -28,11 +28,11 @@
If an ip address is given, the ip address must be valid at the time of service creation.
If the service is set to advertise on a given interface, though the MDNSServer is
configured to ignore this interface, the service won't be advertised on the interface.
-
Optional subtypes
subtypes?:string[]
+
Optional subtypes
subtypes?:string[]
Optional array of subtypes of the service.
Refer to ServiceType for some known examples.
If defined, a txt record will be published with the given service.
-
type
type:string
+
type
type:string
Type of the service.
\ No newline at end of file
diff --git a/docs/modules.html b/docs/modules.html
index e560549..0767184 100644
--- a/docs/modules.html
+++ b/docs/modules.html
@@ -1,4 +1,4 @@
-@homebridge/ciao - v1.1.3
- Preparing search index...
- The search index is not available
@homebridge/ciao - v1.1.5Class CiaoService
The CiaoService class represents a service which can be advertised on the network.
A service is identified by it's fully qualified domain name (FQDN), which consist of the service name, the service type, the protocol and the service domain (.local by default).
@@ -8,7 +8,7 @@A CiaoService class is always bound to a Responder and can be created using the Responder.createService method in the Responder class. Once the instance is created, advertise can be called to announce the service on the network.
-Hierarchy
Index
Methods
Methods
advertise
Hierarchy
Index
Methods
Methods
advertise
This method start the advertising process of the service:
Returns Promise<void>
destroy
Returns Promise<void>
destroy
This method must be called if you want to free the memory used by this service. The service instance is not usable anymore after this call.
If the service is still announced, the service will first be removed from the network by calling end.
-Returns Promise<void>
end
Returns Promise<void>
end
This method will remove the advertisement for the service on all connected network interfaces. If the service is still in the Probing state, probing will simply be cancelled.
Returns Promise<void>
Promise will resolve once the last goodbye packet was sent out
-getFQDN
Returns string
The fully qualified domain name of the service, used to identify the service.
-get Hostname
Returns string
The current hostname of the service.
-get Lower Cased SubtypePTRs
Returns undefined | string[]
Array of subtype pointers (undefined if no subtypes are specified).
-get Port
Returns number
The port the service is advertising for. +
getFQDN
Returns string
The fully qualified domain name of the service, used to identify the service.
+get Hostname
Returns string
The current hostname of the service.
+get Lower Cased SubtypePTRs
Returns undefined | string[]
Array of subtype pointers (undefined if no subtypes are specified).
+get Port
Returns number
The port the service is advertising for. {@code -1} is returned when the port is not yet set.
-get TypePTR
Returns string
The service type pointer.
-update Port
get TypePTR
Returns string
The service type pointer.
+update Port
Sets or updates the port of the service. A new port number can only be set when the service is still UNANNOUNCED. Otherwise an assertion error will be thrown.
Parameters
port: number
The new port number.
-Returns void
update Txt
Returns void
update Txt
Sets or updates the txt of the service.
Parameters
txt: ServiceTxt
The updated txt record.
diff --git a/docs/classes/responder.html b/docs/classes/responder.html index 4de6b6d..6392583 100644 --- a/docs/classes/responder.html +++ b/docs/classes/responder.html @@ -1,13 +1,13 @@ -- Preparing search index...
- The search index is not available
@homebridge/ciao - v1.1.3Class Responder
- Preparing search index...
- The search index is not available
@homebridge/ciao - v1.1.5Class Responder
A Responder instance represents a running MDNSServer and a set of advertised services.
It will handle any service related operations, like advertising, sending goodbye packets or sending record updates. It handles answering questions arriving on the multicast address.
-Hierarchy
Implements
Index
Methods
Methods
create Service
Hierarchy
Implements
Index
Methods
Methods
create Service
Creates a new CiaoService instance and links it to this Responder instance.
Parameters
options: ServiceOptions
Defines all information about the service which should be created.
Returns CiaoService
The newly created CiaoService instance can be used to advertise and manage the created service.
-get Announced Services
Returns IterableIterator<CiaoService>
shutdown
get Announced Services
Returns IterableIterator<CiaoService>
shutdown
This method should be called when you want to unpublish all service exposed by this Responder. This method SHOULD be called before the node application exists, so any host on the network is informed of the shutdown of this machine. diff --git a/docs/enums/protocol.html b/docs/enums/protocol.html index 776df4c..ab78fdf 100644 --- a/docs/enums/protocol.html +++ b/docs/enums/protocol.html @@ -1,6 +1,6 @@ -
- Preparing search index...
- The search index is not available
@homebridge/ciao - v1.1.3Enumeration Protocol
- Preparing search index...
- The search index is not available
@homebridge/ciao - v1.1.5Enumeration Protocol
Defines the transport protocol of a service.
As of RFC 6763 7. TCP must be used for any applications using tcp. For applications using any other transport protocol UDP must be used. This applies to all other transport protocols like SCTP, DCCP, RTMFP, etc
-Index
Enumeration members
Enumeration members
TCP
UDP
Index
Enumeration members
Enumeration members
TCP
UDP
- Preparing search index...
- The search index is not available
@homebridge/ciao - v1.1.3Enumeration ServiceEvent
- Preparing search index...
- The search index is not available
@homebridge/ciao - v1.1.5Enumeration ServiceEvent
Events thrown by a CiaoService
-Index
Enumeration members
Enumeration members
HOSTNAME_ CHANGED
Index
Enumeration members
Enumeration members
HOSTNAME_ CHANGED
Event is called when the Prober identifies that the hostname for the service is already used and thus resolve the name conflict by adjusting the hostname (e.g. adding '(2)' to the hostname). The name change must be persisted. As the hostname is an optional parameter, it is derived from the service name if not supplied. If you supply a custom hostname (not automatically derived from the service name) you must hook up a listener to this event in order for the hostname to be persisted.
-NAME_ CHANGED
NAME_ CHANGED
Event is called when the Prober identifies that the name for the service is already used and thus resolve the name conflict by adjusting the name (e.g. adding '(2)' to the name). This change must be persisted and thus a listener must hook up to this event diff --git a/docs/enums/servicetype.html b/docs/enums/servicetype.html index 13e4542..79ce4d1 100644 --- a/docs/enums/servicetype.html +++ b/docs/enums/servicetype.html @@ -1,5 +1,5 @@ -
- Preparing search index...
- The search index is not available
@homebridge/ciao - v1.1.3Enumeration ServiceType
- Preparing search index...
- The search index is not available
@homebridge/ciao - v1.1.5Enumeration ServiceType
This enum defines some commonly used service types. This is also referred to as service name (as of RFC 6763). A service name must not be longer than 15 characters (RFC 6763 7.2).
-Index
Enumeration members
Enumeration members
AIRDROP
AIRPLAY
AIRPORT
COMPANION_ LINK
DACP
DNS_ SD
HAP
HOMEKIT
HTTP
HTTP_ ALT
IPP
IPPS
PRINTER
RAOP
TOUCH_ ABLE
scanner
Index
Enumeration members
Enumeration members
AIRDROP
AIRPLAY
AIRPORT
COMPANION_ LINK
DACP
DNS_ SD
HAP
HOMEKIT
HTTP
HTTP_ ALT
IPP
IPPS
PRINTER
RAOP
TOUCH_ ABLE
scanner
- Preparing search index...
- The search index is not available
@homebridge/ciao - v1.1.3@homebridge/ciao - v1.1.3
- Preparing search index...
- The search index is not available
@homebridge/ciao - v1.1.5@homebridge/ciao - v1.1.5
@homebridge/ciao
- +
ciao
is a RFC 6763 compliantdns-sd
library, advertising on multicast dns (RFC 6762) diff --git a/docs/interfaces/mdnsserveroptions.html b/docs/interfaces/mdnsserveroptions.html index b9af9d5..8eb5a01 100644 --- a/docs/interfaces/mdnsserveroptions.html +++ b/docs/interfaces/mdnsserveroptions.html @@ -1,10 +1,10 @@ -- Preparing search index...
- The search index is not available
@homebridge/ciao - v1.1.3Interface MDNSServerOptions
- Preparing search index...
- The search index is not available
@homebridge/ciao - v1.1.5Interface MDNSServerOptions
Defines the options passed to the underlying mdns server.
-Hierarchy
Index
Properties
Properties
Optional disable Ipv6
Hierarchy
Index
Properties
Properties
Optional disable Ipv6
If specified, the mdns server will not include any ipv6 address records and not bind any udp6 sockets. This is handy if you want to "bind" on 0.0.0.0 only.
-Optional interface
Optional interface
If specified, the mdns server will only listen on the specified interfaces (allowlist). It can be supplied as a string (representing a single interface) or as an array of strings to define multiple interfaces. diff --git a/docs/interfaces/serviceoptions.html b/docs/interfaces/serviceoptions.html index 520bd2b..f0ec671 100644 --- a/docs/interfaces/serviceoptions.html +++ b/docs/interfaces/serviceoptions.html @@ -1,24 +1,24 @@ -
- Preparing search index...
- The search index is not available
@homebridge/ciao - v1.1.3Interface ServiceOptions
- Preparing search index...
- The search index is not available
@homebridge/ciao - v1.1.5Interface ServiceOptions
Service options supplied when creating a new ciao service.
-Hierarchy
Index
Properties
Properties
Optional disabled Ipv6
Hierarchy
Index
Properties
Properties
Optional disabled Ipv6
The service won't advertise ipv6 address records. This can be used to simulate binding on 0.0.0.0. May be combined with restrictedAddresses.
-Optional domain
Optional domain
Adds ability to set custom domain. Will default to "local". The domain will also be automatically appended to the hostname.
-Optional hostname
Optional hostname
Defines a hostname under which the service can be reached. The specified hostname must not include the TLD. If undefined the service name will be used as default.
-name
name
Instance name of the service
-Optional port
Optional port
Port of the service. If not supplied it must be set later via updatePort BEFORE advertising the service.
-Optional protocol
Optional protocol
The protocol the service uses. Default is TCP.
-Optional restricted Addresses
Optional restricted Addresses
If defined it restricts the service to be advertised on the specified ip addresses or interface names.
If a interface name is specified, ANY address on that given interface will be advertised @@ -28,11 +28,11 @@ If an ip address is given, the ip address must be valid at the time of service creation.
If the service is set to advertise on a given interface, though the MDNSServer is configured to ignore this interface, the service won't be advertised on the interface.
-Optional subtypes
Optional subtypes
Optional array of subtypes of the service. Refer to ServiceType for some known examples.
-Optional txt
Optional txt
If defined, a txt record will be published with the given service.
-type
type
Type of the service.
- Preparing search index...
- The search index is not available
@homebridge/ciao - v1.1.3@homebridge/ciao - v1.1.3
Index
Enumerations
Classes
Interfaces
Type aliases
Properties
Functions
Type aliases
Responder Options
Service Txt
- Preparing search index...
- The search index is not available
@homebridge/ciao - v1.1.5@homebridge/ciao - v1.1.5
Index
Enumerations
Classes
Interfaces
Type aliases
Properties
Functions
Type aliases
Responder Options
Service Txt
A service txt consist of multiple key=value pairs, which get advertised on the network.
Properties
default
Type declaration
get Responder: (options?: ResponderOptions) => Responder
Parameters
Optional options: ResponderOptions
If specified, the options will be passed to the underlying mdns server.
Returns Responder
A Responder instance for the given options. Might be shared with others using the same options.
-Functions
get Responder
Functions
get Responder
This method is used to get a responder for the provided (optional) set of options.
Ciao tries to create as few Responder instances as possible. Thus, it will share the same Responder instance for the same set of options.
diff --git a/package-lock.json b/package-lock.json index 94862a1..8acbf98 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@homebridge/ciao", - "version": "1.1.4", + "version": "1.1.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@homebridge/ciao", - "version": "1.1.4", + "version": "1.1.5", "license": "MIT", "dependencies": { "debug": "^4.3.4", diff --git a/package.json b/package.json index 1761828..239568e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@homebridge/ciao", - "version": "1.1.4", + "version": "1.1.5", "description": "ciao is a RFC 6763 compliant dns-sd library, advertising on multicast dns (RFC 6762) implemented in plain Typescript/JavaScript", "main": "lib/index.js", "types": "lib/index.d.ts",