matterbridge 3.4.5-dev-20251224-457def5 → 3.4.5-dev-20251224-ea793b4
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 +1 -0
- package/dist/dgram/mb_mdns.js +30 -16
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -38,6 +38,7 @@ Advantages:
|
|
|
38
38
|
- [mb_mdns]: Advertise full DNS-SD record set (PTR/SRV/TXT/A/AAAA) for matterbridge.\_http.\_tcp.local on port 8283.
|
|
39
39
|
- [mdns]: Added TXT/SRV/A/AAAA encoders into the Mdns class.
|
|
40
40
|
- [mb_mdns]: Added broadcast parameter to allow advertising when multicast is not available.
|
|
41
|
+
- [mb_mdns]: Added \_matterbridge.\_tcp.local to query and advertise.
|
|
41
42
|
|
|
42
43
|
### Changed
|
|
43
44
|
|
package/dist/dgram/mb_mdns.js
CHANGED
|
@@ -59,9 +59,15 @@ Examples:
|
|
|
59
59
|
mdnsIpv4.filters.push(...filters);
|
|
60
60
|
mdnsIpv6.filters.push(...filters);
|
|
61
61
|
}
|
|
62
|
-
function cleanupAndLogAndExit() {
|
|
62
|
+
async function cleanupAndLogAndExit() {
|
|
63
|
+
if (hasParameter('advertise')) {
|
|
64
|
+
advertise(mdnsIpv4, 0);
|
|
65
|
+
advertise(mdnsIpv6, 0);
|
|
66
|
+
}
|
|
67
|
+
await new Promise((resolve) => setTimeout(resolve, 250));
|
|
63
68
|
mdnsIpv4.stop();
|
|
64
69
|
mdnsIpv6.stop();
|
|
70
|
+
await new Promise((resolve) => setTimeout(resolve, 250));
|
|
65
71
|
mdnsIpv4.logDevices();
|
|
66
72
|
mdnsIpv6.logDevices();
|
|
67
73
|
process.exit(0);
|
|
@@ -71,27 +77,35 @@ Examples:
|
|
|
71
77
|
mdns.sendQuery([
|
|
72
78
|
{ name: '_matterc._udp.local', type: 12, class: 1, unicastResponse: true },
|
|
73
79
|
{ name: '_matter._tcp.local', type: 12, class: 1, unicastResponse: true },
|
|
80
|
+
{ name: '_matterbridge._tcp.local', type: 12, class: 1, unicastResponse: true },
|
|
74
81
|
{ name: '_shelly._tcp.local', type: 12, class: 1, unicastResponse: true },
|
|
75
82
|
{ name: '_http._tcp.local', type: 12, class: 1, unicastResponse: true },
|
|
76
83
|
{ name: '_services._dns-sd._udp.local', type: 12, class: 1, unicastResponse: true },
|
|
77
84
|
]);
|
|
78
85
|
};
|
|
79
|
-
const advertise = (mdns) => {
|
|
80
|
-
mdns.log.info(
|
|
81
|
-
const
|
|
82
|
-
const
|
|
86
|
+
const advertise = (mdns, ttl = 120) => {
|
|
87
|
+
mdns.log.info(`Sending mDNS advertisement for matterbridge service with TTL ${ttl ? ttl.toString() : 'goodbye'}...`);
|
|
88
|
+
const httpServiceType = '_http._tcp.local';
|
|
89
|
+
const matterbridgeServiceType = '_matterbridge._tcp.local';
|
|
90
|
+
const httpInstanceName = 'matterbridge._http._tcp.local';
|
|
91
|
+
const matterbridgeInstanceName = 'matterbridge._matterbridge._tcp.local';
|
|
83
92
|
const hostName = 'matterbridge.local';
|
|
84
93
|
const port = 8283;
|
|
85
|
-
const
|
|
86
|
-
const
|
|
87
|
-
const
|
|
94
|
+
const ptrHttpServiceTypeRdata = mdns.encodeDnsName(httpServiceType);
|
|
95
|
+
const ptrMatterbridgeServiceTypeRdata = mdns.encodeDnsName(matterbridgeServiceType);
|
|
96
|
+
const ptrHttpInstanceRdata = mdns.encodeDnsName(httpInstanceName);
|
|
97
|
+
const ptrMatterbridgeInstanceRdata = mdns.encodeDnsName(matterbridgeInstanceName);
|
|
88
98
|
const srvRdata = mdns.encodeSrvRdata(0, 0, port, hostName);
|
|
89
99
|
const txtRdata = mdns.encodeTxtRdata([`version=${pkg.version}`, 'path=/']);
|
|
90
100
|
const answers = [
|
|
91
|
-
{ name: '_services._dns-sd._udp.local', rtype: 12, rclass: 1, ttl, rdata:
|
|
92
|
-
{ name:
|
|
93
|
-
{ name:
|
|
94
|
-
{ name:
|
|
101
|
+
{ name: '_services._dns-sd._udp.local', rtype: 12, rclass: 1, ttl, rdata: ptrHttpServiceTypeRdata },
|
|
102
|
+
{ name: httpServiceType, rtype: 12, rclass: 1, ttl, rdata: ptrHttpInstanceRdata },
|
|
103
|
+
{ name: '_services._dns-sd._udp.local', rtype: 12, rclass: 1, ttl, rdata: ptrMatterbridgeServiceTypeRdata },
|
|
104
|
+
{ name: matterbridgeServiceType, rtype: 12, rclass: 1, ttl, rdata: ptrMatterbridgeInstanceRdata },
|
|
105
|
+
{ name: httpInstanceName, rtype: 33, rclass: 1 | 32768, ttl, rdata: srvRdata },
|
|
106
|
+
{ name: matterbridgeInstanceName, rtype: 33, rclass: 1 | 32768, ttl, rdata: srvRdata },
|
|
107
|
+
{ name: httpInstanceName, rtype: 16, rclass: 1 | 32768, ttl, rdata: txtRdata },
|
|
108
|
+
{ name: matterbridgeInstanceName, rtype: 16, rclass: 1 | 32768, ttl, rdata: txtRdata },
|
|
95
109
|
];
|
|
96
110
|
try {
|
|
97
111
|
const ipv4 = mdns.getIpv4InterfaceAddress(mdns.interfaceName);
|
|
@@ -132,8 +146,8 @@ Examples:
|
|
|
132
146
|
}
|
|
133
147
|
}
|
|
134
148
|
};
|
|
135
|
-
process.on('SIGINT', () => {
|
|
136
|
-
cleanupAndLogAndExit();
|
|
149
|
+
process.on('SIGINT', async () => {
|
|
150
|
+
await cleanupAndLogAndExit();
|
|
137
151
|
});
|
|
138
152
|
mdnsIpv4.start();
|
|
139
153
|
mdnsIpv4.on('ready', (address) => {
|
|
@@ -167,7 +181,7 @@ Examples:
|
|
|
167
181
|
}, getIntParameter('query') || 10000).unref();
|
|
168
182
|
}
|
|
169
183
|
});
|
|
170
|
-
setTimeout(() => {
|
|
171
|
-
cleanupAndLogAndExit();
|
|
184
|
+
setTimeout(async () => {
|
|
185
|
+
await cleanupAndLogAndExit();
|
|
172
186
|
}, 600000);
|
|
173
187
|
}
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "matterbridge",
|
|
3
|
-
"version": "3.4.5-dev-20251224-
|
|
3
|
+
"version": "3.4.5-dev-20251224-ea793b4",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "matterbridge",
|
|
9
|
-
"version": "3.4.5-dev-20251224-
|
|
9
|
+
"version": "3.4.5-dev-20251224-ea793b4",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@matter/main": "0.15.6",
|
package/package.json
CHANGED