Interface ServiceOptions

Service options supplied when creating a new ciao service.

interface ServiceOptions {
    disabledIpv6?: boolean;
    domain?: string;
    hostname?: string;
    name: string;
    port?: number;
    protocol?: Protocol;
    restrictedAddresses?: string[];
    subtypes?: string[];
    txt?: ServiceTxt;
    type: string;
}

Properties

disabledIpv6?: boolean

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.

domain?: string

Adds ability to set custom domain. Will default to "local". The domain will also be automatically appended to the 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: string

Instance name of the service

port?: number

Port of the service. If not supplied it must be set later via updatePort BEFORE advertising the service.

protocol?: Protocol

The protocol the service uses. Default is TCP.

restrictedAddresses?: string[]

If defined it restricts the service to be advertised on the specified ip addresses or interface names.

If an interface name is specified, ANY address on that given interface will be advertised (if an IP address of the given interface is also given in the array, it will be overridden). If an IP address is specified, the service will only be advertised for the given addresses.

Interface names and addresses can be mixed in the array. 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.

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: string

Type of the service.