matterbridge 3.4.6-dev-20251228-76bd627 → 3.4.6-dev-20251229-8c7522d

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 CHANGED
@@ -32,11 +32,14 @@ Advantages:
32
32
 
33
33
  ### Added
34
34
 
35
+ - [MdnsReflectorClient]: Added already seen cache.
36
+ - [MdnsReflectorServer]: Added --share-with-clients to share mDNS between all reflector clients.
37
+ - [reflector]: [Full guide](https://github.com/Luligu/matterbridge/blob/dev/docker-reflector/Docker%20reflector.md).
38
+
35
39
  ### Changed
36
40
 
37
41
  - [package]: Updated dependencies.
38
-
39
- ### Fixed
42
+ - [reflector]: Bumped `reflector` version to v.1.1.0.
40
43
 
41
44
  <a href="https://www.buymeacoffee.com/luligugithub"><img src="https://matterbridge.io/bmc-button.svg" alt="Buy me a coffee" width="80"></a>
42
45
 
@@ -57,8 +60,6 @@ Advantages:
57
60
 
58
61
  - [package]: Updated dependencies.
59
62
 
60
- ### Fixed
61
-
62
63
  <a href="https://www.buymeacoffee.com/luligugithub"><img src="https://matterbridge.io/bmc-button.svg" alt="Buy me a coffee" width="80"></a>
63
64
 
64
65
  ## [3.4.4] - 2025-12-19
@@ -25,7 +25,13 @@ Options:
25
25
  --noIpv6 Disable IPv6 mDNS server (default: enabled).
26
26
  --no-timeout Disable automatic timeout of 10 minutes. Reflector mode disables timeout automatically.
27
27
  --reflector-client Enable mDNS reflector client (default: disabled).
28
+ --filter <string[]> Filters to apply to incoming mDNS messages.
29
+ --localhost Use localhost addresses to send messages to the container.
28
30
  --reflector-server Enable mDNS reflector server (default: disabled).
31
+ --filter <string[]> Filters to apply to incoming mDNS messages.
32
+ --broadcast Use broadcast addresses to reflect messages to the lan.
33
+ --localhost Use localhost addresses to reflect messages to the lan.
34
+ --share-with-clients Share messages between reflector clients.
29
35
  -d, --debug Enable debug logging (default: disabled).
30
36
  -v, --verbose Enable verbose logging (default: disabled).
31
37
  -s, --silent Enable silent mode, only log notices, warnings and errors.
@@ -98,7 +98,7 @@ export class MdnsReflectorClient {
98
98
  this.log.info(`Ignoring recently reflected ${isMdnsQuery(msg) ? 'query' : 'response'} message from mDNS ipv4 multicast ${BLUE}${rinfo.address}${nf}:${BLUE}${rinfo.port}${nf}`);
99
99
  return;
100
100
  }
101
- this.log.notice(`Sending ${isMdnsQuery(msg) ? 'query' : 'response'} message from mDNS ipv4 multicast ${BLUE}${rinfo.address}${nt}:${BLUE}${rinfo.port}${nt} to unicast ipv4 reflector`);
101
+ this.log.notice(`Sending ${isMdnsQuery(msg) ? 'query' : 'response'} message from mDNS ipv4 multicast ${BLUE}${rinfo.address}${nt}:${BLUE}${rinfo.port}${nt} to ipv4 reflector server`);
102
102
  this.unicastIpv4.send(msg, MDNS_REFLECTOR_HOST_DOCKER, MDNS_REFLECTOR_PORT);
103
103
  this.unicastIpv4.send(msg, MDNS_REFLECTOR_ADDRESS, MDNS_REFLECTOR_PORT);
104
104
  });
@@ -107,7 +107,7 @@ export class MdnsReflectorClient {
107
107
  this.log.info(`Ignoring recently reflected ${isMdnsQuery(msg) ? 'query' : 'response'} message from mDNS ipv6 multicast ${BLUE}${rinfo.address}${nf}:${BLUE}${rinfo.port}${nf}`);
108
108
  return;
109
109
  }
110
- this.log.notice(`Sending ${isMdnsQuery(msg) ? 'query' : 'response'} message from mDNS ipv6 multicast ${BLUE}${rinfo.address}${nt}:${BLUE}${rinfo.port}${nt} to unicast ipv6 reflector`);
110
+ this.log.notice(`Sending ${isMdnsQuery(msg) ? 'query' : 'response'} message from mDNS ipv6 multicast ${BLUE}${rinfo.address}${nt}:${BLUE}${rinfo.port}${nt} to ipv6 reflector server`);
111
111
  this.unicastIpv6.send(msg, MDNS_REFLECTOR_HOST_DOCKER, MDNS_REFLECTOR_PORT);
112
112
  this.unicastIpv6.send(msg, MDNS_REFLECTOR_ADDRESS, MDNS_REFLECTOR_PORT);
113
113
  });
@@ -115,32 +115,36 @@ export class MdnsReflectorClient {
115
115
  if (isMdns(msg)) {
116
116
  this.remember(this.reflectedIpv4, this.fingerprint(msg), this.TTL_MS);
117
117
  this.prune(this.reflectedIpv4);
118
- this.log.notice(`Reflecting ${isMdnsQuery(msg) ? 'query' : 'response'} message from reflector on ipv4 ${BLUE}${rinfo.address}${nt}:${BLUE}${rinfo.port}${nt} to mDNS ipv4 multicast`);
118
+ this.log.notice(`Reflecting ${isMdnsQuery(msg) ? 'query' : 'response'} message from reflector server on ipv4 ${BLUE}${rinfo.address}${nt}:${BLUE}${rinfo.port}${nt} to mDNS ipv4 multicast`);
119
119
  this.mdnsIpv4.send(msg, MDNS_MULTICAST_IPV4_ADDRESS, MDNS_MULTICAST_PORT);
120
120
  if (hasParameter('localhost')) {
121
- this.log.notice(`Reflecting ${isMdnsQuery(msg) ? 'query' : 'response'} message from reflector on ipv4 ${BLUE}${rinfo.address}${nt}:${BLUE}${rinfo.port}${nt} to mDNS ipv4 localhost`);
121
+ this.log.notice(`Reflecting ${isMdnsQuery(msg) ? 'query' : 'response'} message from reflector server on ipv4 ${BLUE}${rinfo.address}${nt}:${BLUE}${rinfo.port}${nt} to mDNS ipv4 localhost`);
122
122
  this.mdnsIpv4.send(msg, 'localhost', MDNS_MULTICAST_PORT);
123
123
  }
124
124
  }
125
125
  else {
126
- this.log.info(`Received message from unicast reflector on ipv4 ${BLUE}${rinfo.address}${nf}:${BLUE}${rinfo.port}${nf}: ${msg.toString()}`);
126
+ this.log.info(`Received message from reflector server on ipv4 ${BLUE}${rinfo.address}${nf}:${BLUE}${rinfo.port}${nf}: ${msg.toString()}`);
127
127
  }
128
128
  });
129
129
  this.unicastIpv6.on('message', (msg, rinfo) => {
130
130
  if (isMdns(msg)) {
131
131
  this.remember(this.reflectedIpv6, this.fingerprint(msg), this.TTL_MS);
132
132
  this.prune(this.reflectedIpv6);
133
- this.log.notice(`Reflecting ${isMdnsQuery(msg) ? 'query' : 'response'} message from reflector on ipv6 ${BLUE}${rinfo.address}${nt}:${BLUE}${rinfo.port}${nt} to mDNS ipv6 multicast`);
133
+ this.log.notice(`Reflecting ${isMdnsQuery(msg) ? 'query' : 'response'} message from reflector server on ipv6 ${BLUE}${rinfo.address}${nt}:${BLUE}${rinfo.port}${nt} to mDNS ipv6 multicast`);
134
134
  this.mdnsIpv6.send(msg, MDNS_MULTICAST_IPV6_ADDRESS, MDNS_MULTICAST_PORT);
135
135
  if (hasParameter('localhost')) {
136
- this.log.notice(`Reflecting ${isMdnsQuery(msg) ? 'query' : 'response'} message from reflector on ipv6 ${BLUE}${rinfo.address}${nt}:${BLUE}${rinfo.port}${nt} to mDNS ipv6 localhost`);
136
+ this.log.notice(`Reflecting ${isMdnsQuery(msg) ? 'query' : 'response'} message from reflector server on ipv6 ${BLUE}${rinfo.address}${nt}:${BLUE}${rinfo.port}${nt} to mDNS ipv6 localhost`);
137
137
  this.mdnsIpv6.send(msg, 'localhost', MDNS_MULTICAST_PORT);
138
138
  }
139
139
  }
140
140
  else {
141
- this.log.info(`Received message from unicast reflector on ipv6 ${BLUE}${rinfo.address}${nf}:${BLUE}${rinfo.port}${nf}: ${msg.toString()}`);
141
+ this.log.info(`Received message from reflector server on ipv6 ${BLUE}${rinfo.address}${nf}:${BLUE}${rinfo.port}${nf}: ${msg.toString()}`);
142
142
  }
143
143
  });
144
+ this.unicastIpv4.send(Buffer.from('Ipv4 reflector client started'), MDNS_REFLECTOR_HOST_DOCKER, MDNS_REFLECTOR_PORT);
145
+ this.unicastIpv4.send(Buffer.from('Ipv4 reflector client started'), MDNS_REFLECTOR_ADDRESS, MDNS_REFLECTOR_PORT);
146
+ this.unicastIpv6.send(Buffer.from('Ipv6 reflector client started'), MDNS_REFLECTOR_HOST_DOCKER, MDNS_REFLECTOR_PORT);
147
+ this.unicastIpv6.send(Buffer.from('Ipv6 reflector client started'), MDNS_REFLECTOR_ADDRESS, MDNS_REFLECTOR_PORT);
144
148
  this.log.notice('mDNS Reflector Client started.');
145
149
  }
146
150
  async stop() {
@@ -1,5 +1,5 @@
1
1
  import os from 'node:os';
2
- import { AnsiLogger, BLUE, nt } from 'node-ansi-logger';
2
+ import { AnsiLogger, BLUE, nt, nf } from 'node-ansi-logger';
3
3
  import { hasParameter, getStringArrayParameter } from '../utils/commandLine.js';
4
4
  import { isMdns, isMdnsQuery, isMdnsResponse, Mdns } from './mdns.js';
5
5
  import { MDNS_MULTICAST_IPV4_ADDRESS, MDNS_MULTICAST_IPV6_ADDRESS, MDNS_MULTICAST_PORT } from './multicast.js';
@@ -135,7 +135,7 @@ export class MdnsReflectorServer {
135
135
  this.log.error(`**UpgradeAddress failed to parse message: ${error.message}`);
136
136
  return msg;
137
137
  }
138
- this.log.info(`**UpgradeAddress message completed. Interface: ${selectedInterfaceName || 'N/A'}, Host IPv4: ${hostIpv4 || 'N/A'}, Host IPv6: ${hostIpv6List.length > 0 ? hostIpv6List.join(', ') : 'N/A'}`);
138
+ this.log.info(`**UpgradeAddress message completed. Interface: ${selectedInterfaceName}, Host IPv4: ${hostIpv4 || 'N/A'}, Host IPv6: ${hostIpv6List.length > 0 ? hostIpv6List.join(', ') : 'N/A'}`);
139
139
  if (hasParameter('log-reflector-messages')) {
140
140
  try {
141
141
  let decodedMessage = this.mdnsIpv4.decodeMdnsMessage(msg);
@@ -201,43 +201,63 @@ export class MdnsReflectorServer {
201
201
  });
202
202
  this.unicastIpv4.on('message', (msg, rinfo) => {
203
203
  this.ipv4Clients.set(`${rinfo.address}:${rinfo.port}`, rinfo);
204
- if (!isMdns(msg))
204
+ if (!isMdns(msg)) {
205
+ this.log.info(`Received message from reflector client on ipv4 ${BLUE}${rinfo.address}${nf}:${BLUE}${rinfo.port}${nf}: ${msg.toString()}`);
205
206
  return;
206
- this.log.notice(`Reflecting message from unicast client ipv4 ${BLUE}${rinfo.address}${nt}:${BLUE}${rinfo.port}${nt} to mDNS ipv4 multicast`);
207
+ }
208
+ this.log.notice(`Reflecting message from reflector client on ipv4 ${BLUE}${rinfo.address}${nt}:${BLUE}${rinfo.port}${nt} to mDNS ipv4 multicast`);
207
209
  const upgradedMsg = isMdnsResponse(msg) ? this.upgradeAddress(msg) : msg;
208
210
  this.mdnsIpv4.send(upgradedMsg, MDNS_MULTICAST_IPV4_ADDRESS, MDNS_MULTICAST_PORT);
209
211
  if (hasParameter('broadcast')) {
210
212
  const broadcastAddress = this.getBroadcastAddress(this.mdnsIpv4);
211
213
  if (broadcastAddress) {
212
- this.log.notice(`Reflecting message from unicast client ipv4 ${BLUE}${rinfo.address}${nt}:${BLUE}${rinfo.port}${nt} to ipv4 broadcast address ${BLUE}${broadcastAddress}${nt}:${BLUE}${MDNS_MULTICAST_PORT}${nt}`);
214
+ this.log.notice(`Reflecting message from reflector client on ipv4 ${BLUE}${rinfo.address}${nt}:${BLUE}${rinfo.port}${nt} to ipv4 broadcast address ${BLUE}${broadcastAddress}${nt}:${BLUE}${MDNS_MULTICAST_PORT}${nt}`);
213
215
  this.mdnsIpv4.send(upgradedMsg, broadcastAddress, MDNS_MULTICAST_PORT);
214
216
  }
215
217
  }
216
218
  if (hasParameter('localhost')) {
217
- this.log.notice(`Reflecting message from unicast client ipv4 ${BLUE}${rinfo.address}${nt}:${BLUE}${rinfo.port}${nt} to ipv4 localhost address ${BLUE}localhost${nt}:${BLUE}${MDNS_MULTICAST_PORT}${nt}`);
219
+ this.log.notice(`Reflecting message from reflector client on ipv4 ${BLUE}${rinfo.address}${nt}:${BLUE}${rinfo.port}${nt} to ipv4 localhost address ${BLUE}localhost${nt}:${BLUE}${MDNS_MULTICAST_PORT}${nt}`);
218
220
  this.mdnsIpv4.send(upgradedMsg, 'localhost', MDNS_MULTICAST_PORT);
219
221
  }
220
- this.unicastIpv4.send(Buffer.from('mDNS Reflector Server reflected your message'), rinfo.address, rinfo.port);
222
+ if (hasParameter('share-with-clients')) {
223
+ this.log.notice(`Sharing message from reflector client on ipv4 ${BLUE}${rinfo.address}${nt}:${BLUE}${rinfo.port}${nt} with other ipv4 reflector clients`);
224
+ for (const client of this.ipv4Clients.values()) {
225
+ if (client.address === rinfo.address && client.port === rinfo.port)
226
+ continue;
227
+ this.unicastIpv4.send(upgradedMsg, client.address, client.port);
228
+ }
229
+ }
230
+ this.unicastIpv4.send(Buffer.from('mDNS ipv4 reflector server reflected your message'), rinfo.address, rinfo.port);
221
231
  });
222
232
  this.unicastIpv6.on('message', (msg, rinfo) => {
223
233
  this.ipv6Clients.set(`${rinfo.address}:${rinfo.port}`, rinfo);
224
- if (!isMdns(msg))
234
+ if (!isMdns(msg)) {
235
+ this.log.info(`Received message from reflector client on ipv6 ${BLUE}${rinfo.address}${nf}:${BLUE}${rinfo.port}${nf}: ${msg.toString()}`);
225
236
  return;
226
- this.log.notice(`Reflecting message from unicast client ipv6 ${BLUE}${rinfo.address}${nt}:${BLUE}${rinfo.port}${nt} to mDNS ipv6 multicast`);
237
+ }
238
+ this.log.notice(`Reflecting message from reflector client on ipv6 ${BLUE}${rinfo.address}${nt}:${BLUE}${rinfo.port}${nt} to mDNS ipv6 multicast`);
227
239
  const upgradedMsg = isMdnsResponse(msg) ? this.upgradeAddress(msg) : msg;
228
240
  this.mdnsIpv6.send(upgradedMsg, MDNS_MULTICAST_IPV6_ADDRESS, MDNS_MULTICAST_PORT);
229
241
  if (hasParameter('broadcast')) {
230
242
  const broadcastAddress = this.getBroadcastAddress(this.mdnsIpv6);
231
243
  if (broadcastAddress) {
232
- this.log.notice(`Reflecting message from unicast client ipv6 ${BLUE}${rinfo.address}${nt}:${BLUE}${rinfo.port}${nt} to ipv6 broadcast address ${BLUE}${broadcastAddress}${nt}:${BLUE}${MDNS_MULTICAST_PORT}${nt}`);
244
+ this.log.notice(`Reflecting message from reflector client on ipv6 ${BLUE}${rinfo.address}${nt}:${BLUE}${rinfo.port}${nt} to ipv6 broadcast address ${BLUE}${broadcastAddress}${nt}:${BLUE}${MDNS_MULTICAST_PORT}${nt}`);
233
245
  this.mdnsIpv6.send(upgradedMsg, broadcastAddress, MDNS_MULTICAST_PORT);
234
246
  }
235
247
  }
236
248
  if (hasParameter('localhost')) {
237
- this.log.notice(`Reflecting message from unicast client ipv6 ${BLUE}${rinfo.address}${nt}:${BLUE}${rinfo.port}${nt} to ipv6 localhost address ${BLUE}localhost${nt}:${BLUE}${MDNS_MULTICAST_PORT}${nt}`);
249
+ this.log.notice(`Reflecting message from reflector client on ipv6 ${BLUE}${rinfo.address}${nt}:${BLUE}${rinfo.port}${nt} to ipv6 localhost address ${BLUE}localhost${nt}:${BLUE}${MDNS_MULTICAST_PORT}${nt}`);
238
250
  this.mdnsIpv6.send(upgradedMsg, 'localhost', MDNS_MULTICAST_PORT);
239
251
  }
240
- this.unicastIpv6.send(Buffer.from('mDNS Reflector Server reflected your message'), rinfo.address, rinfo.port);
252
+ if (hasParameter('share-with-clients')) {
253
+ this.log.notice(`Sharing message from reflector client on ipv6 ${BLUE}${rinfo.address}${nt}:${BLUE}${rinfo.port}${nt} with other ipv6 reflector clients`);
254
+ for (const client of this.ipv6Clients.values()) {
255
+ if (client.address === rinfo.address && client.port === rinfo.port)
256
+ continue;
257
+ this.unicastIpv6.send(upgradedMsg, client.address, client.port);
258
+ }
259
+ }
260
+ this.unicastIpv6.send(Buffer.from('mDNS ipv6 reflector server reflected your message'), rinfo.address, rinfo.port);
241
261
  });
242
262
  this.log.notice('mDNS Reflector Server started.');
243
263
  }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "matterbridge",
3
- "version": "3.4.6-dev-20251228-76bd627",
3
+ "version": "3.4.6-dev-20251229-8c7522d",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "matterbridge",
9
- "version": "3.4.6-dev-20251228-76bd627",
9
+ "version": "3.4.6-dev-20251229-8c7522d",
10
10
  "license": "Apache-2.0",
11
11
  "dependencies": {
12
12
  "@matter/main": "0.15.6",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "matterbridge",
3
- "version": "3.4.6-dev-20251228-76bd627",
3
+ "version": "3.4.6-dev-20251229-8c7522d",
4
4
  "description": "Matterbridge plugin manager for Matter",
5
5
  "author": "https://github.com/Luligu",
6
6
  "license": "Apache-2.0",