matterbridge 3.5.0-dev-20260119-f9ea00e → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +119 -117
- package/dist/broadcastServer.d.ts +115 -0
- package/dist/broadcastServer.d.ts.map +1 -0
- package/dist/broadcastServer.js +117 -0
- package/dist/broadcastServer.js.map +1 -0
- package/dist/broadcastServerTypes.d.ts +43 -0
- package/dist/broadcastServerTypes.d.ts.map +1 -0
- package/dist/broadcastServerTypes.js +24 -0
- package/dist/broadcastServerTypes.js.map +1 -0
- package/dist/cli.d.ts +24 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +97 -1
- package/dist/cli.js.map +1 -0
- package/dist/cliEmitter.d.ts +36 -0
- package/dist/cliEmitter.d.ts.map +1 -0
- package/dist/cliEmitter.js +37 -0
- package/dist/cliEmitter.js.map +1 -0
- package/dist/cliHistory.d.ts +42 -0
- package/dist/cliHistory.d.ts.map +1 -0
- package/dist/cliHistory.js +38 -0
- package/dist/cliHistory.js.map +1 -0
- package/dist/clusters/export.d.ts +1 -0
- package/dist/clusters/export.d.ts.map +1 -0
- package/dist/clusters/export.js +2 -0
- package/dist/clusters/export.js.map +1 -0
- package/dist/deviceManager.d.ts +108 -0
- package/dist/deviceManager.d.ts.map +1 -0
- package/dist/deviceManager.js +113 -1
- package/dist/deviceManager.js.map +1 -0
- package/dist/devices/airConditioner.d.ts +75 -0
- package/dist/devices/airConditioner.d.ts.map +1 -0
- package/dist/devices/airConditioner.js +57 -0
- package/dist/devices/airConditioner.js.map +1 -0
- package/dist/devices/batteryStorage.d.ts +43 -0
- package/dist/devices/batteryStorage.d.ts.map +1 -0
- package/dist/devices/batteryStorage.js +48 -1
- package/dist/devices/batteryStorage.js.map +1 -0
- package/dist/devices/cooktop.d.ts +55 -0
- package/dist/devices/cooktop.d.ts.map +1 -0
- package/dist/devices/cooktop.js +56 -0
- package/dist/devices/cooktop.js.map +1 -0
- package/dist/devices/dishwasher.d.ts +55 -0
- package/dist/devices/dishwasher.d.ts.map +1 -0
- package/dist/devices/dishwasher.js +57 -0
- package/dist/devices/dishwasher.js.map +1 -0
- package/dist/devices/evse.d.ts +57 -0
- package/dist/devices/evse.d.ts.map +1 -0
- package/dist/devices/evse.js +74 -10
- package/dist/devices/evse.js.map +1 -0
- package/dist/devices/export.d.ts +1 -0
- package/dist/devices/export.d.ts.map +1 -0
- package/dist/devices/export.js +5 -0
- package/dist/devices/export.js.map +1 -0
- package/dist/devices/extractorHood.d.ts +41 -0
- package/dist/devices/extractorHood.d.ts.map +1 -0
- package/dist/devices/extractorHood.js +43 -0
- package/dist/devices/extractorHood.js.map +1 -0
- package/dist/devices/heatPump.d.ts +43 -0
- package/dist/devices/heatPump.d.ts.map +1 -0
- package/dist/devices/heatPump.js +50 -2
- package/dist/devices/heatPump.js.map +1 -0
- package/dist/devices/laundryDryer.d.ts +58 -0
- package/dist/devices/laundryDryer.d.ts.map +1 -0
- package/dist/devices/laundryDryer.js +62 -3
- package/dist/devices/laundryDryer.js.map +1 -0
- package/dist/devices/laundryWasher.d.ts +64 -0
- package/dist/devices/laundryWasher.d.ts.map +1 -0
- package/dist/devices/laundryWasher.js +70 -4
- package/dist/devices/laundryWasher.js.map +1 -0
- package/dist/devices/microwaveOven.d.ts +77 -1
- package/dist/devices/microwaveOven.d.ts.map +1 -0
- package/dist/devices/microwaveOven.js +88 -5
- package/dist/devices/microwaveOven.js.map +1 -0
- package/dist/devices/oven.d.ts +82 -0
- package/dist/devices/oven.d.ts.map +1 -0
- package/dist/devices/oven.js +85 -0
- package/dist/devices/oven.js.map +1 -0
- package/dist/devices/refrigerator.d.ts +100 -0
- package/dist/devices/refrigerator.d.ts.map +1 -0
- package/dist/devices/refrigerator.js +102 -0
- package/dist/devices/refrigerator.js.map +1 -0
- package/dist/devices/roboticVacuumCleaner.d.ts +83 -0
- package/dist/devices/roboticVacuumCleaner.d.ts.map +1 -0
- package/dist/devices/roboticVacuumCleaner.js +100 -9
- package/dist/devices/roboticVacuumCleaner.js.map +1 -0
- package/dist/devices/solarPower.d.ts +36 -0
- package/dist/devices/solarPower.d.ts.map +1 -0
- package/dist/devices/solarPower.js +38 -0
- package/dist/devices/solarPower.js.map +1 -0
- package/dist/devices/speaker.d.ts +79 -0
- package/dist/devices/speaker.d.ts.map +1 -0
- package/dist/devices/speaker.js +84 -0
- package/dist/devices/speaker.js.map +1 -0
- package/dist/devices/temperatureControl.d.ts +21 -0
- package/dist/devices/temperatureControl.d.ts.map +1 -0
- package/dist/devices/temperatureControl.js +24 -3
- package/dist/devices/temperatureControl.js.map +1 -0
- package/dist/devices/waterHeater.d.ts +74 -0
- package/dist/devices/waterHeater.d.ts.map +1 -0
- package/dist/devices/waterHeater.js +82 -2
- package/dist/devices/waterHeater.js.map +1 -0
- package/dist/dgram/coap.d.ts +171 -0
- package/dist/dgram/coap.d.ts.map +1 -0
- package/dist/dgram/coap.js +126 -13
- package/dist/dgram/coap.js.map +1 -0
- package/dist/dgram/dgram.d.ts +99 -0
- package/dist/dgram/dgram.d.ts.map +1 -0
- package/dist/dgram/dgram.js +114 -2
- package/dist/dgram/dgram.js.map +1 -0
- package/dist/dgram/mb_coap.d.ts +23 -0
- package/dist/dgram/mb_coap.d.ts.map +1 -0
- package/dist/dgram/mb_coap.js +41 -3
- package/dist/dgram/mb_coap.js.map +1 -0
- package/dist/dgram/mb_mdns.d.ts +23 -0
- package/dist/dgram/mb_mdns.d.ts.map +1 -0
- package/dist/dgram/mb_mdns.js +80 -24
- package/dist/dgram/mb_mdns.js.map +1 -0
- package/dist/dgram/mdns.d.ts +187 -4
- package/dist/dgram/mdns.d.ts.map +1 -0
- package/dist/dgram/mdns.js +371 -139
- package/dist/dgram/mdns.js.map +1 -0
- package/dist/dgram/multicast.d.ts +49 -0
- package/dist/dgram/multicast.d.ts.map +1 -0
- package/dist/dgram/multicast.js +62 -1
- package/dist/dgram/multicast.js.map +1 -0
- package/dist/dgram/unicast.d.ts +53 -0
- package/dist/dgram/unicast.d.ts.map +1 -0
- package/dist/dgram/unicast.js +60 -0
- package/dist/dgram/unicast.js.map +1 -0
- package/dist/frontend.d.ts +187 -0
- package/dist/frontend.d.ts.map +1 -0
- package/dist/frontend.js +498 -37
- package/dist/frontend.js.map +1 -0
- package/dist/frontendTypes.d.ts +57 -0
- package/dist/frontendTypes.d.ts.map +1 -0
- package/dist/frontendTypes.js +45 -0
- package/dist/frontendTypes.js.map +1 -0
- package/dist/helpers.d.ts +43 -0
- package/dist/helpers.d.ts.map +1 -0
- package/dist/helpers.js +53 -0
- package/dist/helpers.js.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -0
- package/dist/jestutils/export.d.ts +1 -0
- package/dist/jestutils/export.d.ts.map +1 -0
- package/dist/jestutils/export.js +1 -0
- package/dist/jestutils/export.js.map +1 -0
- package/dist/jestutils/jestHelpers.d.ts +255 -0
- package/dist/jestutils/jestHelpers.d.ts.map +1 -0
- package/dist/jestutils/jestHelpers.js +372 -14
- package/dist/jestutils/jestHelpers.js.map +1 -0
- package/dist/logger/export.d.ts +1 -0
- package/dist/logger/export.d.ts.map +1 -0
- package/dist/logger/export.js +1 -0
- package/dist/logger/export.js.map +1 -0
- package/dist/matter/behaviors.d.ts +1 -0
- package/dist/matter/behaviors.d.ts.map +1 -0
- package/dist/matter/behaviors.js +2 -0
- package/dist/matter/behaviors.js.map +1 -0
- package/dist/matter/clusters.d.ts +1 -0
- package/dist/matter/clusters.d.ts.map +1 -0
- package/dist/matter/clusters.js +2 -0
- package/dist/matter/clusters.js.map +1 -0
- package/dist/matter/devices.d.ts +1 -0
- package/dist/matter/devices.d.ts.map +1 -0
- package/dist/matter/devices.js +2 -0
- package/dist/matter/devices.js.map +1 -0
- package/dist/matter/endpoints.d.ts +1 -0
- package/dist/matter/endpoints.d.ts.map +1 -0
- package/dist/matter/endpoints.js +2 -0
- package/dist/matter/endpoints.js.map +1 -0
- package/dist/matter/export.d.ts +1 -0
- package/dist/matter/export.d.ts.map +1 -0
- package/dist/matter/export.js +2 -0
- package/dist/matter/export.js.map +1 -0
- package/dist/matter/types.d.ts +1 -0
- package/dist/matter/types.d.ts.map +1 -0
- package/dist/matter/types.js +2 -0
- package/dist/matter/types.js.map +1 -0
- package/dist/matterNode.d.ts +258 -0
- package/dist/matterNode.d.ts.map +1 -0
- package/dist/matterNode.js +359 -8
- package/dist/matterNode.js.map +1 -0
- package/dist/matterbridge.d.ts +362 -0
- package/dist/matterbridge.d.ts.map +1 -0
- package/dist/matterbridge.js +842 -46
- package/dist/matterbridge.js.map +1 -0
- package/dist/matterbridgeAccessoryPlatform.d.ts +36 -0
- package/dist/matterbridgeAccessoryPlatform.d.ts.map +1 -0
- package/dist/matterbridgeAccessoryPlatform.js +38 -0
- package/dist/matterbridgeAccessoryPlatform.js.map +1 -0
- package/dist/matterbridgeBehaviors.d.ts +24 -0
- package/dist/matterbridgeBehaviors.d.ts.map +1 -0
- package/dist/matterbridgeBehaviors.js +68 -5
- package/dist/matterbridgeBehaviors.js.map +1 -0
- package/dist/matterbridgeDeviceTypes.d.ts +649 -0
- package/dist/matterbridgeDeviceTypes.d.ts.map +1 -0
- package/dist/matterbridgeDeviceTypes.js +673 -6
- package/dist/matterbridgeDeviceTypes.js.map +1 -0
- package/dist/matterbridgeDynamicPlatform.d.ts +36 -0
- package/dist/matterbridgeDynamicPlatform.d.ts.map +1 -0
- package/dist/matterbridgeDynamicPlatform.js +38 -0
- package/dist/matterbridgeDynamicPlatform.js.map +1 -0
- package/dist/matterbridgeEndpoint.d.ts +1332 -0
- package/dist/matterbridgeEndpoint.d.ts.map +1 -0
- package/dist/matterbridgeEndpoint.js +1457 -53
- package/dist/matterbridgeEndpoint.js.map +1 -0
- package/dist/matterbridgeEndpointHelpers.d.ts +425 -0
- package/dist/matterbridgeEndpointHelpers.d.ts.map +1 -0
- package/dist/matterbridgeEndpointHelpers.js +483 -20
- package/dist/matterbridgeEndpointHelpers.js.map +1 -0
- package/dist/matterbridgeEndpointTypes.d.ts +70 -0
- package/dist/matterbridgeEndpointTypes.d.ts.map +1 -0
- package/dist/matterbridgeEndpointTypes.js +25 -0
- package/dist/matterbridgeEndpointTypes.js.map +1 -0
- package/dist/matterbridgePlatform.d.ts +425 -0
- package/dist/matterbridgePlatform.d.ts.map +1 -0
- package/dist/matterbridgePlatform.js +451 -1
- package/dist/matterbridgePlatform.js.map +1 -0
- package/dist/matterbridgeTypes.d.ts +46 -0
- package/dist/matterbridgeTypes.d.ts.map +1 -0
- package/dist/matterbridgeTypes.js +26 -0
- package/dist/matterbridgeTypes.js.map +1 -0
- package/dist/pluginManager.d.ts +305 -0
- package/dist/pluginManager.d.ts.map +1 -0
- package/dist/pluginManager.js +341 -5
- package/dist/pluginManager.js.map +1 -0
- package/dist/shelly.d.ts +157 -0
- package/dist/shelly.d.ts.map +1 -0
- package/dist/shelly.js +178 -7
- package/dist/shelly.js.map +1 -0
- package/dist/storage/export.d.ts +1 -0
- package/dist/storage/export.d.ts.map +1 -0
- package/dist/storage/export.js +1 -0
- package/dist/storage/export.js.map +1 -0
- package/dist/update.d.ts +75 -0
- package/dist/update.d.ts.map +1 -0
- package/dist/update.js +93 -1
- package/dist/update.js.map +1 -0
- package/dist/utils/colorUtils.d.ts +77 -0
- package/dist/utils/colorUtils.d.ts.map +1 -0
- package/dist/utils/colorUtils.js +97 -2
- package/dist/utils/colorUtils.js.map +1 -0
- package/dist/utils/commandLine.d.ts +60 -0
- package/dist/utils/commandLine.d.ts.map +1 -0
- package/dist/utils/commandLine.js +60 -0
- package/dist/utils/commandLine.js.map +1 -0
- package/dist/utils/copyDirectory.d.ts +33 -0
- package/dist/utils/copyDirectory.d.ts.map +1 -0
- package/dist/utils/copyDirectory.js +37 -0
- package/dist/utils/copyDirectory.js.map +1 -0
- package/dist/utils/createDirectory.d.ts +32 -0
- package/dist/utils/createDirectory.d.ts.map +1 -0
- package/dist/utils/createDirectory.js +33 -0
- package/dist/utils/createDirectory.js.map +1 -0
- package/dist/utils/createZip.d.ts +38 -0
- package/dist/utils/createZip.d.ts.map +1 -0
- package/dist/utils/createZip.js +47 -2
- package/dist/utils/createZip.js.map +1 -0
- package/dist/utils/deepCopy.d.ts +31 -0
- package/dist/utils/deepCopy.d.ts.map +1 -0
- package/dist/utils/deepCopy.js +39 -0
- package/dist/utils/deepCopy.js.map +1 -0
- package/dist/utils/deepEqual.d.ts +53 -0
- package/dist/utils/deepEqual.d.ts.map +1 -0
- package/dist/utils/deepEqual.js +72 -1
- package/dist/utils/deepEqual.js.map +1 -0
- package/dist/utils/error.d.ts +42 -0
- package/dist/utils/error.d.ts.map +1 -0
- package/dist/utils/error.js +42 -0
- package/dist/utils/error.js.map +1 -0
- package/dist/utils/export.d.ts +1 -0
- package/dist/utils/export.d.ts.map +1 -0
- package/dist/utils/export.js +1 -0
- package/dist/utils/export.js.map +1 -0
- package/dist/utils/format.d.ts +49 -0
- package/dist/utils/format.d.ts.map +1 -0
- package/dist/utils/format.js +49 -0
- package/dist/utils/format.js.map +1 -0
- package/dist/utils/hex.d.ts +85 -0
- package/dist/utils/hex.d.ts.map +1 -0
- package/dist/utils/hex.js +124 -0
- package/dist/utils/hex.js.map +1 -0
- package/dist/utils/inspector.d.ts +63 -0
- package/dist/utils/inspector.d.ts.map +1 -0
- package/dist/utils/inspector.js +69 -1
- package/dist/utils/inspector.js.map +1 -0
- package/dist/utils/isValid.d.ts +93 -0
- package/dist/utils/isValid.d.ts.map +1 -0
- package/dist/utils/isValid.js +93 -0
- package/dist/utils/isValid.js.map +1 -0
- package/dist/utils/network.d.ts +116 -0
- package/dist/utils/network.d.ts.map +1 -0
- package/dist/utils/network.js +126 -5
- package/dist/utils/network.js.map +1 -0
- package/dist/utils/spawn.d.ts +32 -0
- package/dist/utils/spawn.d.ts.map +1 -0
- package/dist/utils/spawn.js +71 -1
- package/dist/utils/spawn.js.map +1 -0
- package/dist/utils/tracker.d.ts +56 -0
- package/dist/utils/tracker.d.ts.map +1 -0
- package/dist/utils/tracker.js +64 -1
- package/dist/utils/tracker.js.map +1 -0
- package/dist/utils/wait.d.ts +51 -0
- package/dist/utils/wait.d.ts.map +1 -0
- package/dist/utils/wait.js +60 -8
- package/dist/utils/wait.js.map +1 -0
- package/dist/workerGlobalPrefix.d.ts +24 -0
- package/dist/workerGlobalPrefix.d.ts.map +1 -0
- package/dist/workerGlobalPrefix.js +37 -5
- package/dist/workerGlobalPrefix.js.map +1 -0
- package/dist/workerTypes.d.ts +25 -0
- package/dist/workerTypes.d.ts.map +1 -0
- package/dist/workerTypes.js +24 -0
- package/dist/workerTypes.js.map +1 -0
- package/dist/workers.d.ts +61 -0
- package/dist/workers.d.ts.map +1 -0
- package/dist/workers.js +68 -4
- package/dist/workers.js.map +1 -0
- package/frontend/build/assets/index.js +4 -4
- package/frontend/package.json +1 -1
- package/npm-shrinkwrap.json +5 -35
- package/package.json +7 -7
package/dist/dgram/mb_mdns.js
CHANGED
|
@@ -1,9 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description This file contains the bin mb_mdns for the class Mdns.
|
|
3
|
+
* @file src/dgram/mb_mdns.ts
|
|
4
|
+
* @author Luca Liguori
|
|
5
|
+
* @created 2025-07-22
|
|
6
|
+
* @version 1.0.0
|
|
7
|
+
* @license Apache-2.0
|
|
8
|
+
*
|
|
9
|
+
* Copyright 2025, 2026, 2027 Luca Liguori.
|
|
10
|
+
*
|
|
11
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
12
|
+
* you may not use this file except in compliance with the License.
|
|
13
|
+
* You may obtain a copy of the License at
|
|
14
|
+
*
|
|
15
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
16
|
+
*
|
|
17
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
18
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
19
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
20
|
+
* See the License for the specific language governing permissions and
|
|
21
|
+
* limitations under the License.
|
|
22
|
+
*/
|
|
1
23
|
import os from 'node:os';
|
|
24
|
+
// Net imports
|
|
2
25
|
import { MDNS_MULTICAST_IPV4_ADDRESS, MDNS_MULTICAST_IPV6_ADDRESS, MDNS_MULTICAST_PORT, Mdns } from '@matterbridge/dgram';
|
|
26
|
+
// Utils imports
|
|
3
27
|
import { getIntParameter, getParameter, getStringArrayParameter, hasParameter } from '@matterbridge/utils';
|
|
28
|
+
// istanbul ignore next
|
|
4
29
|
{
|
|
5
30
|
if (hasParameter('h') || hasParameter('help')) {
|
|
31
|
+
// eslint-disable-next-line no-console
|
|
6
32
|
console.log(`Copyright (c) Matterbridge. All rights reserved. Version 1.0.0.\n`);
|
|
33
|
+
// eslint-disable-next-line no-console
|
|
7
34
|
console.log(`Usage: mb_mdns [options...]
|
|
8
35
|
|
|
9
36
|
If no command line is provided, mb_mdns shows all incoming mDNS records on all interfaces (0.0.0.0 and ::).
|
|
@@ -44,8 +71,10 @@ Examples:
|
|
|
44
71
|
# Query each 5s and listen for _matterbridge._tcp.local service records
|
|
45
72
|
mb_mdns --query 5000 --filter _matterbridge._tcp.local
|
|
46
73
|
`);
|
|
74
|
+
// eslint-disable-next-line n/no-process-exit
|
|
47
75
|
process.exit(0);
|
|
48
76
|
}
|
|
77
|
+
// Dynamic JSON import (Node >= 20) with import attributes
|
|
49
78
|
const { default: pkg } = await import('../../package.json', { with: { type: 'json' } });
|
|
50
79
|
let mdnsIpv4QueryInterval;
|
|
51
80
|
let mdnsIpv6QueryInterval;
|
|
@@ -53,6 +82,9 @@ Examples:
|
|
|
53
82
|
let mdnsIpv6AdvertiseInterval;
|
|
54
83
|
let mdnsIpv4 = undefined;
|
|
55
84
|
let mdnsIpv6 = undefined;
|
|
85
|
+
/**
|
|
86
|
+
* Cleanup and log device information before exiting.
|
|
87
|
+
*/
|
|
56
88
|
async function cleanupAndLogAndExit() {
|
|
57
89
|
clearInterval(mdnsIpv4QueryInterval);
|
|
58
90
|
clearInterval(mdnsIpv6QueryInterval);
|
|
@@ -60,36 +92,42 @@ Examples:
|
|
|
60
92
|
clearInterval(mdnsIpv6AdvertiseInterval);
|
|
61
93
|
if (hasParameter('advertise')) {
|
|
62
94
|
if (mdnsIpv4)
|
|
63
|
-
advertise(mdnsIpv4, 0);
|
|
95
|
+
advertise(mdnsIpv4, 0); // Send goodbye with TTL 0
|
|
64
96
|
if (mdnsIpv6)
|
|
65
|
-
advertise(mdnsIpv6, 0);
|
|
97
|
+
advertise(mdnsIpv6, 0); // Send goodbye with TTL 0
|
|
66
98
|
}
|
|
67
|
-
await new Promise((resolve) => setTimeout(resolve, 250));
|
|
99
|
+
await new Promise((resolve) => setTimeout(resolve, 250)); // Wait for 250ms to allow goodbye messages to be sent
|
|
68
100
|
mdnsIpv4?.stop();
|
|
69
101
|
mdnsIpv6?.stop();
|
|
70
102
|
mdnsIpv4?.logDevices();
|
|
71
103
|
mdnsIpv6?.logDevices();
|
|
72
|
-
await new Promise((resolve) => setTimeout(resolve, 250));
|
|
104
|
+
await new Promise((resolve) => setTimeout(resolve, 250)); // Wait for 250ms to allow sockets to close
|
|
73
105
|
}
|
|
74
106
|
const query = (mdns) => {
|
|
75
107
|
mdns.log.info('Sending mDNS query for common services...');
|
|
76
108
|
try {
|
|
77
109
|
mdns.sendQuery([
|
|
78
|
-
{ name: '_matterc._udp.local', type: 12
|
|
79
|
-
{ name: '_matter._tcp.local', type: 12
|
|
80
|
-
{ name: '_matterbridge._tcp.local', type: 12
|
|
81
|
-
{ name: '_home-assistant._tcp.local', type: 12
|
|
82
|
-
{ name: '_shelly._tcp.local', type: 12
|
|
83
|
-
{ name: '_mqtt._tcp.local', type: 12
|
|
84
|
-
{ name: '_http._tcp.local', type: 12
|
|
85
|
-
{ name: '_googlecast._tcp.local', type: 12
|
|
86
|
-
{ name: '_services._dns-sd._udp.local', type: 12
|
|
110
|
+
{ name: '_matterc._udp.local', type: 12 /* DnsRecordType.PTR */, class: 1 /* DnsClass.IN */, unicastResponse: true },
|
|
111
|
+
{ name: '_matter._tcp.local', type: 12 /* DnsRecordType.PTR */, class: 1 /* DnsClass.IN */, unicastResponse: true },
|
|
112
|
+
{ name: '_matterbridge._tcp.local', type: 12 /* DnsRecordType.PTR */, class: 1 /* DnsClass.IN */, unicastResponse: true },
|
|
113
|
+
{ name: '_home-assistant._tcp.local', type: 12 /* DnsRecordType.PTR */, class: 1 /* DnsClass.IN */, unicastResponse: true },
|
|
114
|
+
{ name: '_shelly._tcp.local', type: 12 /* DnsRecordType.PTR */, class: 1 /* DnsClass.IN */, unicastResponse: true },
|
|
115
|
+
{ name: '_mqtt._tcp.local', type: 12 /* DnsRecordType.PTR */, class: 1 /* DnsClass.IN */, unicastResponse: true },
|
|
116
|
+
{ name: '_http._tcp.local', type: 12 /* DnsRecordType.PTR */, class: 1 /* DnsClass.IN */, unicastResponse: true },
|
|
117
|
+
{ name: '_googlecast._tcp.local', type: 12 /* DnsRecordType.PTR */, class: 1 /* DnsClass.IN */, unicastResponse: true },
|
|
118
|
+
{ name: '_services._dns-sd._udp.local', type: 12 /* DnsRecordType.PTR */, class: 1 /* DnsClass.IN */, unicastResponse: true },
|
|
87
119
|
]);
|
|
88
120
|
}
|
|
89
121
|
catch (error) {
|
|
90
122
|
mdns.log.error(`Error sending mDNS query: ${error.message}`);
|
|
91
123
|
}
|
|
92
124
|
};
|
|
125
|
+
/**
|
|
126
|
+
* Sends an mDNS advertisement for the HTTP service over UDP IPv4.
|
|
127
|
+
*
|
|
128
|
+
* @param {Mdns} mdns - The Mdns instance to use for sending the advertisement.
|
|
129
|
+
* @param {number} [ttl] - The time-to-live for the advertisement records. Defaults to 120 seconds. Send 0 for goodbye.
|
|
130
|
+
*/
|
|
93
131
|
const advertise = (mdns, ttl = 120) => {
|
|
94
132
|
mdns.log.info(`Sending mDNS advertisement for matterbridge service with TTL ${ttl ? ttl.toString() : 'goodbye'}...`);
|
|
95
133
|
const httpServiceType = '_http._tcp.local';
|
|
@@ -105,17 +143,25 @@ Examples:
|
|
|
105
143
|
const srvRdata = mdns.encodeSrvRdata(0, 0, port, hostName);
|
|
106
144
|
const txtRdata = mdns.encodeTxtRdata([`version=${pkg.version}`, 'path=/']);
|
|
107
145
|
const answers = [
|
|
108
|
-
|
|
109
|
-
{ name:
|
|
110
|
-
{ name:
|
|
111
|
-
{ name:
|
|
112
|
-
{ name:
|
|
113
|
-
|
|
114
|
-
{ name: httpInstanceName, rtype:
|
|
115
|
-
|
|
146
|
+
// PTR records for service types and instances
|
|
147
|
+
{ name: '_services._dns-sd._udp.local', rtype: 12 /* DnsRecordType.PTR */, rclass: 1 /* DnsClass.IN */, ttl, rdata: ptrHttpServiceTypeRdata },
|
|
148
|
+
{ name: httpServiceType, rtype: 12 /* DnsRecordType.PTR */, rclass: 1 /* DnsClass.IN */, ttl, rdata: ptrHttpInstanceRdata },
|
|
149
|
+
{ name: '_services._dns-sd._udp.local', rtype: 12 /* DnsRecordType.PTR */, rclass: 1 /* DnsClass.IN */, ttl, rdata: ptrMatterbridgeServiceTypeRdata },
|
|
150
|
+
{ name: matterbridgeServiceType, rtype: 12 /* DnsRecordType.PTR */, rclass: 1 /* DnsClass.IN */, ttl, rdata: ptrMatterbridgeInstanceRdata },
|
|
151
|
+
// SRV record for the HTTP instance
|
|
152
|
+
{ name: httpInstanceName, rtype: 33 /* DnsRecordType.SRV */, rclass: 1 /* DnsClass.IN */ | 32768 /* DnsClassFlag.FLUSH */, ttl, rdata: srvRdata },
|
|
153
|
+
// SRV record for the matterbridge instance
|
|
154
|
+
{ name: matterbridgeInstanceName, rtype: 33 /* DnsRecordType.SRV */, rclass: 1 /* DnsClass.IN */ | 32768 /* DnsClassFlag.FLUSH */, ttl, rdata: srvRdata },
|
|
155
|
+
// TXT record for the HTTP instance
|
|
156
|
+
{ name: httpInstanceName, rtype: 16 /* DnsRecordType.TXT */, rclass: 1 /* DnsClass.IN */ | 32768 /* DnsClassFlag.FLUSH */, ttl, rdata: txtRdata },
|
|
157
|
+
// TXT record for the matterbridge instance
|
|
158
|
+
{ name: matterbridgeInstanceName, rtype: 16 /* DnsRecordType.TXT */, rclass: 1 /* DnsClass.IN */ | 32768 /* DnsClassFlag.FLUSH */, ttl, rdata: txtRdata },
|
|
116
159
|
];
|
|
160
|
+
// Always attempt to add both A and all AAAA records (best effort), regardless of the socket family.
|
|
117
161
|
const interfaces = os.networkInterfaces();
|
|
162
|
+
// Use specified interface name if provided
|
|
118
163
|
let interfaceInfos = mdns.interfaceName ? interfaces[mdns.interfaceName] : undefined;
|
|
164
|
+
// Find the first non-internal IPv4 and IPv6 addresses if interface name is not provided or not found
|
|
119
165
|
if (!interfaceInfos) {
|
|
120
166
|
interfaceInfos = [];
|
|
121
167
|
for (const name of Object.keys(interfaces)) {
|
|
@@ -126,14 +172,15 @@ Examples:
|
|
|
126
172
|
}
|
|
127
173
|
}
|
|
128
174
|
}
|
|
175
|
+
// Encode A and AAAA records for all non-internal addresses of the selected interface
|
|
129
176
|
for (const info of interfaceInfos) {
|
|
130
177
|
if (info.family === 'IPv4' && !info.internal) {
|
|
131
178
|
const ipv4 = info.address;
|
|
132
|
-
answers.push({ name: hostName, rtype: 1
|
|
179
|
+
answers.push({ name: hostName, rtype: 1 /* DnsRecordType.A */, rclass: 1 /* DnsClass.IN */ | 32768 /* DnsClassFlag.FLUSH */, ttl, rdata: mdns.encodeA(ipv4) });
|
|
133
180
|
}
|
|
134
181
|
else if (info.family === 'IPv6' && !info.internal) {
|
|
135
182
|
const ipv6 = info.address;
|
|
136
|
-
answers.push({ name: hostName, rtype: 28
|
|
183
|
+
answers.push({ name: hostName, rtype: 28 /* DnsRecordType.AAAA */, rclass: 1 /* DnsClass.IN */ | 32768 /* DnsClassFlag.FLUSH */, ttl, rdata: mdns.encodeAAAA(ipv6) });
|
|
137
184
|
}
|
|
138
185
|
}
|
|
139
186
|
try {
|
|
@@ -147,12 +194,15 @@ Examples:
|
|
|
147
194
|
mdnsIpv4 = new Mdns('mDNS Server udp4', MDNS_MULTICAST_IPV4_ADDRESS, MDNS_MULTICAST_PORT, 'udp4', true, getParameter('interfaceName'), getParameter('ipv4InterfaceAddress') || '0.0.0.0', getParameter('outgoingIpv4InterfaceAddress'));
|
|
148
195
|
if (hasParameter('v') || hasParameter('verbose'))
|
|
149
196
|
mdnsIpv4.listNetworkInterfaces();
|
|
197
|
+
// Apply filters if any
|
|
150
198
|
const filters = getStringArrayParameter('filter');
|
|
151
199
|
if (filters)
|
|
152
200
|
mdnsIpv4.filters.push(...filters);
|
|
201
|
+
// Handle errors
|
|
153
202
|
mdnsIpv4.on('error', (err) => {
|
|
154
203
|
mdnsIpv4?.log.error(`mDNS udp4 Server error: ${err.message}\n${err.stack}`);
|
|
155
204
|
});
|
|
205
|
+
// Start the IPv4 mDNS server
|
|
156
206
|
mdnsIpv4.start();
|
|
157
207
|
mdnsIpv4.on('ready', (address) => {
|
|
158
208
|
mdnsIpv4?.socket.setMulticastLoopback(false);
|
|
@@ -171,12 +221,15 @@ Examples:
|
|
|
171
221
|
mdnsIpv6 = new Mdns('mDNS Server udp6', MDNS_MULTICAST_IPV6_ADDRESS, MDNS_MULTICAST_PORT, 'udp6', true, getParameter('interfaceName'), getParameter('ipv6InterfaceAddress') || '::', getParameter('outgoingIpv6InterfaceAddress'));
|
|
172
222
|
if (hasParameter('v') || hasParameter('verbose'))
|
|
173
223
|
mdnsIpv6.listNetworkInterfaces();
|
|
224
|
+
// Apply filters if any
|
|
174
225
|
const filters = getStringArrayParameter('filter');
|
|
175
226
|
if (filters)
|
|
176
227
|
mdnsIpv6.filters.push(...filters);
|
|
228
|
+
// Handle errors
|
|
177
229
|
mdnsIpv6.on('error', (err) => {
|
|
178
230
|
mdnsIpv6?.log.error(`mDNS udp6 Server error: ${err.message}\n${err.stack}`);
|
|
179
231
|
});
|
|
232
|
+
// Start the IPv6 mDNS server
|
|
180
233
|
mdnsIpv6.start();
|
|
181
234
|
mdnsIpv6.on('ready', (address) => {
|
|
182
235
|
mdnsIpv6?.socket.setMulticastLoopback(false);
|
|
@@ -191,15 +244,18 @@ Examples:
|
|
|
191
244
|
}
|
|
192
245
|
});
|
|
193
246
|
}
|
|
247
|
+
// Handle Ctrl+C (SIGINT) and SIGTERM to stop and log devices
|
|
194
248
|
process.on('SIGINT', async () => {
|
|
195
249
|
await cleanupAndLogAndExit();
|
|
196
250
|
});
|
|
197
251
|
process.on('SIGTERM', async () => {
|
|
198
252
|
await cleanupAndLogAndExit();
|
|
199
253
|
});
|
|
254
|
+
// Exit after a timeout to avoid running indefinitely in test environments
|
|
200
255
|
if (!hasParameter('no-timeout')) {
|
|
201
256
|
setTimeout(async () => {
|
|
202
257
|
await cleanupAndLogAndExit();
|
|
203
|
-
}, 600000).unref();
|
|
258
|
+
}, 600000).unref(); // 10 minutes timeout to exit if no activity
|
|
204
259
|
}
|
|
205
260
|
}
|
|
261
|
+
//# sourceMappingURL=mb_mdns.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mb_mdns.js","sourceRoot":"","sources":["../../src/dgram/mb_mdns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH,OAAO,EAAE,MAAM,SAAS,CAAC;AAEzB,cAAc;AACd,OAAO,EAAE,2BAA2B,EAAE,2BAA2B,EAAE,mBAAmB,EAAyC,IAAI,EAAE,MAAM,qBAAqB,CAAC;AACjK,gBAAgB;AAChB,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAE3G,uBAAuB;AACvB,CAAC;IACC,IAAI,YAAY,CAAC,GAAG,CAAC,IAAI,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9C,sCAAsC;QACtC,OAAO,CAAC,GAAG,CAAC,mEAAmE,CAAC,CAAC;QACjF,sCAAsC;QACtC,OAAO,CAAC,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;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AAC,EAAE,MAAM,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,4CAA4C;IAClE,CAAC;AACH,CAAC"}
|
package/dist/dgram/mdns.d.ts
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description This file contains the class Mdns.
|
|
3
|
+
* @file mdns.ts
|
|
4
|
+
* @author Luca Liguori
|
|
5
|
+
* @created 2025-03-22
|
|
6
|
+
* @version 1.0.0
|
|
7
|
+
* @license Apache-2.0
|
|
8
|
+
*
|
|
9
|
+
* Copyright 2025, 2026, 2027 Luca Liguori.
|
|
10
|
+
*
|
|
11
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
12
|
+
* you may not use this file except in compliance with the License.
|
|
13
|
+
* You may obtain a copy of the License at
|
|
14
|
+
*
|
|
15
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
16
|
+
*
|
|
17
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
18
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
19
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
20
|
+
* See the License for the specific language governing permissions and
|
|
21
|
+
* limitations under the License.
|
|
22
|
+
*/
|
|
1
23
|
import dgram from 'node:dgram';
|
|
2
24
|
import { AnsiLogger } from 'node-ansi-logger';
|
|
3
25
|
import { Multicast } from './multicast.js';
|
|
@@ -94,13 +116,13 @@ export declare const enum DnsRecordType {
|
|
|
94
116
|
DLV = 32769
|
|
95
117
|
}
|
|
96
118
|
export declare const enum DnsClass {
|
|
97
|
-
IN = 1
|
|
98
|
-
CH = 3
|
|
99
|
-
HS = 4
|
|
119
|
+
IN = 1,// Internet
|
|
120
|
+
CH = 3,// Chaos
|
|
121
|
+
HS = 4,// Hesiod
|
|
100
122
|
ANY = 255
|
|
101
123
|
}
|
|
102
124
|
export declare const enum DnsClassFlag {
|
|
103
|
-
FLUSH = 32768
|
|
125
|
+
FLUSH = 32768,// For answers (resource records)
|
|
104
126
|
QU = 32768
|
|
105
127
|
}
|
|
106
128
|
export interface MdnsMessage {
|
|
@@ -134,8 +156,26 @@ interface MdnsRecord {
|
|
|
134
156
|
ttl: number;
|
|
135
157
|
data: string;
|
|
136
158
|
}
|
|
159
|
+
/**
|
|
160
|
+
* Checks if a given message is an mDNS message.
|
|
161
|
+
*
|
|
162
|
+
* @param {Buffer} message - The message buffer to check.
|
|
163
|
+
* @returns {boolean} True if the message is an mDNS message, false otherwise.
|
|
164
|
+
*/
|
|
137
165
|
export declare function isMdns(message: Buffer): boolean;
|
|
166
|
+
/**
|
|
167
|
+
* Checks if a given mDNS message is a query.
|
|
168
|
+
*
|
|
169
|
+
* @param {Buffer} message - The mDNS message buffer to check.
|
|
170
|
+
* @returns {boolean} True if the message is a query, false otherwise.
|
|
171
|
+
*/
|
|
138
172
|
export declare function isMdnsQuery(message: Buffer): boolean;
|
|
173
|
+
/**
|
|
174
|
+
* Checks if a given mDNS message is a query.
|
|
175
|
+
*
|
|
176
|
+
* @param {Buffer} message - The mDNS message buffer to check.
|
|
177
|
+
* @returns {boolean} True if the message is a query, false otherwise.
|
|
178
|
+
*/
|
|
139
179
|
export declare function isMdnsResponse(message: Buffer): boolean;
|
|
140
180
|
export declare class Mdns extends Multicast {
|
|
141
181
|
deviceQueries: Map<string, {
|
|
@@ -148,30 +188,143 @@ export declare class Mdns extends Multicast {
|
|
|
148
188
|
dataPTR?: string;
|
|
149
189
|
}>;
|
|
150
190
|
filters: string[];
|
|
191
|
+
/**
|
|
192
|
+
* Creates an instance of the Mdns class.
|
|
193
|
+
*
|
|
194
|
+
* @param {string} name - The internal name of the mDNS server for the logs.
|
|
195
|
+
* @param {string} multicastAddress - The multicast address for mDNS (i.e. 224.0.0.251 for udp4 or ff02::fb for udp6).
|
|
196
|
+
* @param {number} multicastPort - The port for mDNS (i.e. 5353).
|
|
197
|
+
* @param {('udp4' | 'udp6')} socketType - The type of socket to create (either 'udp4' or 'udp6').
|
|
198
|
+
* @param {boolean} [reuseAddr] - Whether to reuse the address. Defaults to true.
|
|
199
|
+
* @param {string} [interfaceName] - The optional name of the network interface to use.
|
|
200
|
+
* @param {string} [interfaceAddress] - The optional IP address of the network interface to use.
|
|
201
|
+
* @param {string} [outgoingInterfaceAddress] - The address of the outgoing network interface.
|
|
202
|
+
*/
|
|
151
203
|
constructor(name: string, multicastAddress: string, multicastPort: number, socketType: 'udp4' | 'udp6', reuseAddr?: boolean | undefined, interfaceName?: string, interfaceAddress?: string, outgoingInterfaceAddress?: string);
|
|
152
204
|
onQuery(rinfo: dgram.RemoteInfo, _query: MdnsMessage): void;
|
|
153
205
|
onResponse(rinfo: dgram.RemoteInfo, _response: MdnsMessage): void;
|
|
154
206
|
onMessage(msg: Buffer, rinfo: dgram.RemoteInfo): void;
|
|
207
|
+
/**
|
|
208
|
+
* Decodes an mDNS message, including the header, question section, answer section,
|
|
209
|
+
* authority section, and additional section.
|
|
210
|
+
*
|
|
211
|
+
* @param {Buffer} msg - The raw mDNS message buffer.
|
|
212
|
+
* @returns {MdnsMessage} An object representing the decoded mDNS message.
|
|
213
|
+
* @throws {Error} if the message is too short.
|
|
214
|
+
*/
|
|
155
215
|
decodeMdnsMessage(msg: Buffer): MdnsMessage;
|
|
216
|
+
/**
|
|
217
|
+
* Decodes a DNS name from a buffer, handling compression.
|
|
218
|
+
*
|
|
219
|
+
* @param {Buffer} msg - The full mDNS message buffer.
|
|
220
|
+
* @param {number} offset - The offset at which the DNS name starts.
|
|
221
|
+
* @returns {{ name: string; newOffset: number }} An object with the decoded name and the new offset.
|
|
222
|
+
* @throws {Error} if the offset exceeds the buffer length or too many iterations are performed.
|
|
223
|
+
*/
|
|
156
224
|
decodeDnsName(msg: Buffer, offset: number): {
|
|
157
225
|
name: string;
|
|
158
226
|
newOffset: number;
|
|
159
227
|
};
|
|
228
|
+
/**
|
|
229
|
+
* Encodes a domain name into the DNS label format.
|
|
230
|
+
*
|
|
231
|
+
* For example, "example.local" becomes:
|
|
232
|
+
* [7] "example" [5] "local" [0]
|
|
233
|
+
*
|
|
234
|
+
* @param {string} name - The domain name to encode.
|
|
235
|
+
* @returns {Buffer} The encoded domain name as a Buffer.
|
|
236
|
+
*/
|
|
160
237
|
encodeDnsName(name: string): Buffer;
|
|
238
|
+
/**
|
|
239
|
+
* Encodes TXT record RDATA.
|
|
240
|
+
*
|
|
241
|
+
* In DNS/mDNS, TXT RDATA is a sequence of one or more <character-string>,
|
|
242
|
+
* each encoded as: [length byte][UTF-8 bytes].
|
|
243
|
+
*
|
|
244
|
+
* @param {string[]} txt - Array of TXT entries, e.g. ["key=value", "path=/"].
|
|
245
|
+
* @returns {Buffer} Encoded TXT RDATA.
|
|
246
|
+
* @throws {Error} If any entry exceeds 255 bytes.
|
|
247
|
+
*
|
|
248
|
+
* @example
|
|
249
|
+
* const txtRdata = mdns.encodeTxtRdata(['txtvers=1', 'path=/']);
|
|
250
|
+
* mdns.sendResponse([
|
|
251
|
+
* { name: 'example._http._tcp.local', rtype: DnsRecordType.TXT, rclass: DnsClass.IN | DnsClassFlag.FLUSH, ttl: 120, rdata: txtRdata },
|
|
252
|
+
* ]);
|
|
253
|
+
*/
|
|
161
254
|
encodeTxtRdata(txt: string[]): Buffer;
|
|
255
|
+
/**
|
|
256
|
+
* Encodes SRV record RDATA.
|
|
257
|
+
*
|
|
258
|
+
* SRV RDATA layout (RFC 2782):
|
|
259
|
+
* - priority (2 bytes)
|
|
260
|
+
* - weight (2 bytes)
|
|
261
|
+
* - port (2 bytes)
|
|
262
|
+
* - target (DNS name)
|
|
263
|
+
*
|
|
264
|
+
* @param {number} priority - SRV priority.
|
|
265
|
+
* @param {number} weight - SRV weight.
|
|
266
|
+
* @param {number} port - Service port.
|
|
267
|
+
* @param {string} target - Target hostname (e.g. "matterbridge.local").
|
|
268
|
+
* @returns {Buffer} Encoded SRV RDATA.
|
|
269
|
+
*/
|
|
162
270
|
encodeSrvRdata(priority: number, weight: number, port: number, target: string): Buffer;
|
|
271
|
+
/**
|
|
272
|
+
* Encodes an IPv4 address for an A record RDATA (4 bytes).
|
|
273
|
+
*
|
|
274
|
+
* @param {string} ipv4 - IPv4 address, e.g. "192.168.1.10".
|
|
275
|
+
* @returns {Buffer} 4-byte buffer.
|
|
276
|
+
* @throws {Error} If the address is not a valid dotted-quad.
|
|
277
|
+
*/
|
|
163
278
|
encodeA(ipv4: string): Buffer;
|
|
279
|
+
/**
|
|
280
|
+
* Encodes an IPv6 address for an AAAA record RDATA (16 bytes).
|
|
281
|
+
*
|
|
282
|
+
* Supports the "::" zero-compression form and ignores an optional scope id
|
|
283
|
+
* suffix (e.g. "fe80::1%12" or "fe80::1%eth0").
|
|
284
|
+
*
|
|
285
|
+
* @param {string} ipv6WithOptionalScope - IPv6 address (optionally with scope id).
|
|
286
|
+
* @returns {Buffer} 16-byte buffer.
|
|
287
|
+
* @throws {Error} If the address is not a valid IPv6 literal.
|
|
288
|
+
*/
|
|
164
289
|
encodeAAAA(ipv6WithOptionalScope: string): Buffer;
|
|
290
|
+
/**
|
|
291
|
+
* Decodes a DNS resource record.
|
|
292
|
+
*
|
|
293
|
+
* @param {Buffer} msg - The full mDNS message buffer.
|
|
294
|
+
* @param {number} offset - The offset at which the resource record starts.
|
|
295
|
+
* @returns {{ record: MdnsRecord; newOffset: number }} An object containing the decoded record and the new offset.
|
|
296
|
+
*/
|
|
165
297
|
decodeResourceRecord(msg: Buffer, offset: number): {
|
|
166
298
|
record: MdnsRecord;
|
|
167
299
|
newOffset: number;
|
|
168
300
|
};
|
|
301
|
+
/**
|
|
302
|
+
* Sends a DNS query with multiple questions.
|
|
303
|
+
*
|
|
304
|
+
* @param {Array<{ name: string; type: number; class: number; unicastResponse?: boolean }>} questions - Array of questions
|
|
305
|
+
* to include in the query.
|
|
306
|
+
* @returns {Buffer<ArrayBuffer>} The constructed query buffer.
|
|
307
|
+
*
|
|
308
|
+
* @remarks
|
|
309
|
+
* Each question should have a name (e.g., "_http._tcp.local"), type (e.g., DnsRecordType.PTR), class (e.g., DnsClass.IN),
|
|
310
|
+
* and an optional unicastResponse flag (this will add the DnsClassFlag.QU flag to the query).
|
|
311
|
+
*/
|
|
169
312
|
sendQuery(questions: {
|
|
170
313
|
name: string;
|
|
171
314
|
type: number;
|
|
172
315
|
class: number;
|
|
173
316
|
unicastResponse?: boolean;
|
|
174
317
|
}[]): Buffer<ArrayBuffer>;
|
|
318
|
+
/**
|
|
319
|
+
* Constructs an mDNS response packet and sends it to the multicast address and port.
|
|
320
|
+
*
|
|
321
|
+
* @param {Array<{ name: string; rtype: number; rclass: number; ttl: number; rdata: Buffer }>} answers - Array of answer records.
|
|
322
|
+
* @returns {Buffer<ArrayBuffer>} The constructed response buffer.
|
|
323
|
+
*
|
|
324
|
+
* @example
|
|
325
|
+
* const ptrRdata = mdnsIpv4.encodeDnsName('matterbridge._http._tcp.local');
|
|
326
|
+
* mdnsIpv4.sendResponse([{ name: '_http._tcp.local', rtype: DnsRecordType.PTR, rclass: DnsClass.IN, ttl: 120, rdata: ptrRdata }]);
|
|
327
|
+
*/
|
|
175
328
|
sendResponse(answers: {
|
|
176
329
|
name: string;
|
|
177
330
|
rtype: number;
|
|
@@ -179,10 +332,40 @@ export declare class Mdns extends Multicast {
|
|
|
179
332
|
ttl: number;
|
|
180
333
|
rdata: Buffer;
|
|
181
334
|
}[]): Buffer<ArrayBuffer>;
|
|
335
|
+
/**
|
|
336
|
+
* Converts a DNS record type numeric value to its string representation.
|
|
337
|
+
*
|
|
338
|
+
* @param {number} type - The numeric DNS record type.
|
|
339
|
+
* @returns {string} The string representation of the record type.
|
|
340
|
+
*/
|
|
182
341
|
dnsTypeToString(type: number): string;
|
|
342
|
+
/**
|
|
343
|
+
* Converts a DNS response class numeric value to its string representation.
|
|
344
|
+
*
|
|
345
|
+
* @param {number} cls - The numeric DNS class.
|
|
346
|
+
* @returns {string} The string representation of the DNS class.
|
|
347
|
+
*/
|
|
183
348
|
dnsResponseClassToString(cls: number): string;
|
|
349
|
+
/**
|
|
350
|
+
* Converts a DNS question class to a human-readable string.
|
|
351
|
+
* Adds support for mDNS QU (unicast-response) bit.
|
|
352
|
+
*
|
|
353
|
+
* @param {number} cls - The numeric question class.
|
|
354
|
+
* @returns {string} The string representation, e.g. "IN|QU"
|
|
355
|
+
*/
|
|
184
356
|
dnsQuestionClassToString(cls: number): string;
|
|
357
|
+
/**
|
|
358
|
+
* Logs the decoded mDNS message header.
|
|
359
|
+
*
|
|
360
|
+
* @param {MdnsMessage} msg - The mDNS message header object.
|
|
361
|
+
* @param {AnsiLogger} [log] - The logger to use (defaults to this.log).
|
|
362
|
+
* @param {string} [text] - Optional additional text to include in the log.
|
|
363
|
+
*/
|
|
185
364
|
logMdnsMessage(msg: MdnsMessage, log?: AnsiLogger, text?: string): void;
|
|
365
|
+
/**
|
|
366
|
+
* Logs the discovered devices from the mDNS queries and responses.
|
|
367
|
+
*/
|
|
186
368
|
logDevices(): void;
|
|
187
369
|
}
|
|
188
370
|
export {};
|
|
371
|
+
//# sourceMappingURL=mdns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mdns.d.ts","sourceRoot":"","sources":["../../src/dgram/mdns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,KAAK,MAAM,YAAY,CAAC;AAG/B,OAAO,EAAE,UAAU,EAA+C,MAAM,kBAAkB,CAAC;AAM3F,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,0BAAkB,aAAa;IAC7B,CAAC,IAAI;IACL,EAAE,IAAI;IACN,EAAE,IAAI;IACN,EAAE,IAAI;IACN,KAAK,IAAI;IACT,GAAG,IAAI;IACP,EAAE,IAAI;IACN,EAAE,IAAI;IACN,EAAE,IAAI;IACN,IAAI,KAAK;IACT,GAAG,KAAK;IACR,GAAG,KAAK;IACR,KAAK,KAAK;IACV,KAAK,KAAK;IACV,EAAE,KAAK;IACP,GAAG,KAAK;IACR,EAAE,KAA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