matterbridge 3.4.5 → 3.4.6-dev-20251228-e06f048

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.
Files changed (335) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/broadcastServer.js +0 -117
  3. package/dist/broadcastServerTypes.js +0 -24
  4. package/dist/cli.js +1 -97
  5. package/dist/cliEmitter.js +0 -37
  6. package/dist/cliHistory.js +0 -38
  7. package/dist/clusters/export.js +0 -2
  8. package/dist/deviceManager.js +1 -113
  9. package/dist/devices/airConditioner.js +0 -57
  10. package/dist/devices/batteryStorage.js +1 -48
  11. package/dist/devices/cooktop.js +0 -56
  12. package/dist/devices/dishwasher.js +0 -57
  13. package/dist/devices/evse.js +10 -74
  14. package/dist/devices/export.js +0 -5
  15. package/dist/devices/extractorHood.js +0 -43
  16. package/dist/devices/heatPump.js +2 -50
  17. package/dist/devices/laundryDryer.js +3 -62
  18. package/dist/devices/laundryWasher.js +4 -70
  19. package/dist/devices/microwaveOven.js +5 -88
  20. package/dist/devices/oven.js +0 -85
  21. package/dist/devices/refrigerator.js +0 -102
  22. package/dist/devices/roboticVacuumCleaner.js +9 -100
  23. package/dist/devices/solarPower.js +0 -38
  24. package/dist/devices/speaker.js +0 -84
  25. package/dist/devices/temperatureControl.js +3 -24
  26. package/dist/devices/waterHeater.js +2 -82
  27. package/dist/dgram/coap.js +13 -126
  28. package/dist/dgram/dgram.js +2 -114
  29. package/dist/dgram/mb_coap.js +3 -41
  30. package/dist/dgram/mb_mdns.js +22 -76
  31. package/dist/dgram/mdns.js +137 -351
  32. package/dist/dgram/mdnsReflectorClient.js +5 -29
  33. package/dist/dgram/mdnsReflectorServer.js +8 -49
  34. package/dist/dgram/mdnsReflectorTypes.js +1 -24
  35. package/dist/dgram/multicast.js +1 -62
  36. package/dist/dgram/unicast.js +0 -60
  37. package/dist/frontend.js +38 -485
  38. package/dist/frontendTypes.js +0 -45
  39. package/dist/helpers.js +0 -53
  40. package/dist/index.js +0 -25
  41. package/dist/jestutils/export.js +0 -1
  42. package/dist/jestutils/jestHelpers.js +14 -371
  43. package/dist/logger/export.js +0 -1
  44. package/dist/matter/behaviors.js +0 -2
  45. package/dist/matter/clusters.js +0 -2
  46. package/dist/matter/devices.js +0 -2
  47. package/dist/matter/endpoints.js +0 -2
  48. package/dist/matter/export.js +0 -3
  49. package/dist/matter/types.js +0 -3
  50. package/dist/matterNode.js +8 -369
  51. package/dist/matterbridge.js +46 -824
  52. package/dist/matterbridgeAccessoryPlatform.js +0 -38
  53. package/dist/matterbridgeBehaviors.js +5 -68
  54. package/dist/matterbridgeDeviceTypes.js +14 -635
  55. package/dist/matterbridgeDynamicPlatform.js +0 -38
  56. package/dist/matterbridgeEndpoint.js +53 -1457
  57. package/dist/matterbridgeEndpointHelpers.js +20 -483
  58. package/dist/matterbridgeEndpointTypes.js +0 -25
  59. package/dist/matterbridgePlatform.js +1 -451
  60. package/dist/matterbridgeTypes.js +0 -26
  61. package/dist/pluginManager.js +5 -341
  62. package/dist/shelly.js +7 -178
  63. package/dist/storage/export.js +0 -1
  64. package/dist/update.js +1 -93
  65. package/dist/utils/colorUtils.js +2 -97
  66. package/dist/utils/commandLine.js +0 -60
  67. package/dist/utils/copyDirectory.js +0 -37
  68. package/dist/utils/createDirectory.js +0 -33
  69. package/dist/utils/createZip.js +2 -47
  70. package/dist/utils/deepCopy.js +0 -39
  71. package/dist/utils/deepEqual.js +1 -72
  72. package/dist/utils/error.js +0 -42
  73. package/dist/utils/export.js +0 -1
  74. package/dist/utils/format.js +0 -49
  75. package/dist/utils/hex.js +0 -124
  76. package/dist/utils/inspector.js +1 -69
  77. package/dist/utils/isvalid.js +0 -101
  78. package/dist/utils/network.js +5 -103
  79. package/dist/utils/spawn.js +1 -71
  80. package/dist/utils/tracker.js +1 -64
  81. package/dist/utils/wait.js +8 -60
  82. package/dist/workerGlobalPrefix.js +5 -37
  83. package/dist/workerTypes.js +0 -24
  84. package/dist/workers.js +4 -68
  85. package/npm-shrinkwrap.json +2 -2
  86. package/package.json +1 -2
  87. package/dist/broadcastServer.d.ts +0 -144
  88. package/dist/broadcastServer.d.ts.map +0 -1
  89. package/dist/broadcastServer.js.map +0 -1
  90. package/dist/broadcastServerTypes.d.ts +0 -841
  91. package/dist/broadcastServerTypes.d.ts.map +0 -1
  92. package/dist/broadcastServerTypes.js.map +0 -1
  93. package/dist/cli.d.ts +0 -30
  94. package/dist/cli.d.ts.map +0 -1
  95. package/dist/cli.js.map +0 -1
  96. package/dist/cliEmitter.d.ts +0 -50
  97. package/dist/cliEmitter.d.ts.map +0 -1
  98. package/dist/cliEmitter.js.map +0 -1
  99. package/dist/cliHistory.d.ts +0 -48
  100. package/dist/cliHistory.d.ts.map +0 -1
  101. package/dist/cliHistory.js.map +0 -1
  102. package/dist/clusters/export.d.ts +0 -2
  103. package/dist/clusters/export.d.ts.map +0 -1
  104. package/dist/clusters/export.js.map +0 -1
  105. package/dist/deviceManager.d.ts +0 -135
  106. package/dist/deviceManager.d.ts.map +0 -1
  107. package/dist/deviceManager.js.map +0 -1
  108. package/dist/devices/airConditioner.d.ts +0 -98
  109. package/dist/devices/airConditioner.d.ts.map +0 -1
  110. package/dist/devices/airConditioner.js.map +0 -1
  111. package/dist/devices/batteryStorage.d.ts +0 -48
  112. package/dist/devices/batteryStorage.d.ts.map +0 -1
  113. package/dist/devices/batteryStorage.js.map +0 -1
  114. package/dist/devices/cooktop.d.ts +0 -61
  115. package/dist/devices/cooktop.d.ts.map +0 -1
  116. package/dist/devices/cooktop.js.map +0 -1
  117. package/dist/devices/dishwasher.d.ts +0 -71
  118. package/dist/devices/dishwasher.d.ts.map +0 -1
  119. package/dist/devices/dishwasher.js.map +0 -1
  120. package/dist/devices/evse.d.ts +0 -76
  121. package/dist/devices/evse.d.ts.map +0 -1
  122. package/dist/devices/evse.js.map +0 -1
  123. package/dist/devices/export.d.ts +0 -17
  124. package/dist/devices/export.d.ts.map +0 -1
  125. package/dist/devices/export.js.map +0 -1
  126. package/dist/devices/extractorHood.d.ts +0 -46
  127. package/dist/devices/extractorHood.d.ts.map +0 -1
  128. package/dist/devices/extractorHood.js.map +0 -1
  129. package/dist/devices/heatPump.d.ts +0 -47
  130. package/dist/devices/heatPump.d.ts.map +0 -1
  131. package/dist/devices/heatPump.js.map +0 -1
  132. package/dist/devices/laundryDryer.d.ts +0 -67
  133. package/dist/devices/laundryDryer.d.ts.map +0 -1
  134. package/dist/devices/laundryDryer.js.map +0 -1
  135. package/dist/devices/laundryWasher.d.ts +0 -81
  136. package/dist/devices/laundryWasher.d.ts.map +0 -1
  137. package/dist/devices/laundryWasher.js.map +0 -1
  138. package/dist/devices/microwaveOven.d.ts +0 -168
  139. package/dist/devices/microwaveOven.d.ts.map +0 -1
  140. package/dist/devices/microwaveOven.js.map +0 -1
  141. package/dist/devices/oven.d.ts +0 -105
  142. package/dist/devices/oven.d.ts.map +0 -1
  143. package/dist/devices/oven.js.map +0 -1
  144. package/dist/devices/refrigerator.d.ts +0 -118
  145. package/dist/devices/refrigerator.d.ts.map +0 -1
  146. package/dist/devices/refrigerator.js.map +0 -1
  147. package/dist/devices/roboticVacuumCleaner.d.ts +0 -112
  148. package/dist/devices/roboticVacuumCleaner.d.ts.map +0 -1
  149. package/dist/devices/roboticVacuumCleaner.js.map +0 -1
  150. package/dist/devices/solarPower.d.ts +0 -40
  151. package/dist/devices/solarPower.d.ts.map +0 -1
  152. package/dist/devices/solarPower.js.map +0 -1
  153. package/dist/devices/speaker.d.ts +0 -87
  154. package/dist/devices/speaker.d.ts.map +0 -1
  155. package/dist/devices/speaker.js.map +0 -1
  156. package/dist/devices/temperatureControl.d.ts +0 -166
  157. package/dist/devices/temperatureControl.d.ts.map +0 -1
  158. package/dist/devices/temperatureControl.js.map +0 -1
  159. package/dist/devices/waterHeater.d.ts +0 -111
  160. package/dist/devices/waterHeater.d.ts.map +0 -1
  161. package/dist/devices/waterHeater.js.map +0 -1
  162. package/dist/dgram/coap.d.ts +0 -205
  163. package/dist/dgram/coap.d.ts.map +0 -1
  164. package/dist/dgram/coap.js.map +0 -1
  165. package/dist/dgram/dgram.d.ts +0 -143
  166. package/dist/dgram/dgram.d.ts.map +0 -1
  167. package/dist/dgram/dgram.js.map +0 -1
  168. package/dist/dgram/mb_coap.d.ts +0 -24
  169. package/dist/dgram/mb_coap.d.ts.map +0 -1
  170. package/dist/dgram/mb_coap.js.map +0 -1
  171. package/dist/dgram/mb_mdns.d.ts +0 -24
  172. package/dist/dgram/mb_mdns.d.ts.map +0 -1
  173. package/dist/dgram/mb_mdns.js.map +0 -1
  174. package/dist/dgram/mdns.d.ts +0 -350
  175. package/dist/dgram/mdns.d.ts.map +0 -1
  176. package/dist/dgram/mdns.js.map +0 -1
  177. package/dist/dgram/mdnsReflectorClient.d.ts +0 -39
  178. package/dist/dgram/mdnsReflectorClient.d.ts.map +0 -1
  179. package/dist/dgram/mdnsReflectorClient.js.map +0 -1
  180. package/dist/dgram/mdnsReflectorServer.d.ts +0 -54
  181. package/dist/dgram/mdnsReflectorServer.d.ts.map +0 -1
  182. package/dist/dgram/mdnsReflectorServer.js.map +0 -1
  183. package/dist/dgram/mdnsReflectorTypes.d.ts +0 -28
  184. package/dist/dgram/mdnsReflectorTypes.d.ts.map +0 -1
  185. package/dist/dgram/mdnsReflectorTypes.js.map +0 -1
  186. package/dist/dgram/multicast.d.ts +0 -67
  187. package/dist/dgram/multicast.d.ts.map +0 -1
  188. package/dist/dgram/multicast.js.map +0 -1
  189. package/dist/dgram/unicast.d.ts +0 -64
  190. package/dist/dgram/unicast.d.ts.map +0 -1
  191. package/dist/dgram/unicast.js.map +0 -1
  192. package/dist/frontend.d.ts +0 -245
  193. package/dist/frontend.d.ts.map +0 -1
  194. package/dist/frontend.js.map +0 -1
  195. package/dist/frontendTypes.d.ts +0 -529
  196. package/dist/frontendTypes.d.ts.map +0 -1
  197. package/dist/frontendTypes.js.map +0 -1
  198. package/dist/helpers.d.ts +0 -48
  199. package/dist/helpers.d.ts.map +0 -1
  200. package/dist/helpers.js.map +0 -1
  201. package/dist/index.d.ts +0 -34
  202. package/dist/index.d.ts.map +0 -1
  203. package/dist/index.js.map +0 -1
  204. package/dist/jestutils/export.d.ts +0 -2
  205. package/dist/jestutils/export.d.ts.map +0 -1
  206. package/dist/jestutils/export.js.map +0 -1
  207. package/dist/jestutils/jestHelpers.d.ts +0 -345
  208. package/dist/jestutils/jestHelpers.d.ts.map +0 -1
  209. package/dist/jestutils/jestHelpers.js.map +0 -1
  210. package/dist/logger/export.d.ts +0 -2
  211. package/dist/logger/export.d.ts.map +0 -1
  212. package/dist/logger/export.js.map +0 -1
  213. package/dist/matter/behaviors.d.ts +0 -2
  214. package/dist/matter/behaviors.d.ts.map +0 -1
  215. package/dist/matter/behaviors.js.map +0 -1
  216. package/dist/matter/clusters.d.ts +0 -2
  217. package/dist/matter/clusters.d.ts.map +0 -1
  218. package/dist/matter/clusters.js.map +0 -1
  219. package/dist/matter/devices.d.ts +0 -2
  220. package/dist/matter/devices.d.ts.map +0 -1
  221. package/dist/matter/devices.js.map +0 -1
  222. package/dist/matter/endpoints.d.ts +0 -2
  223. package/dist/matter/endpoints.d.ts.map +0 -1
  224. package/dist/matter/endpoints.js.map +0 -1
  225. package/dist/matter/export.d.ts +0 -5
  226. package/dist/matter/export.d.ts.map +0 -1
  227. package/dist/matter/export.js.map +0 -1
  228. package/dist/matter/types.d.ts +0 -3
  229. package/dist/matter/types.d.ts.map +0 -1
  230. package/dist/matter/types.js.map +0 -1
  231. package/dist/matterNode.d.ts +0 -342
  232. package/dist/matterNode.d.ts.map +0 -1
  233. package/dist/matterNode.js.map +0 -1
  234. package/dist/matterbridge.d.ts +0 -505
  235. package/dist/matterbridge.d.ts.map +0 -1
  236. package/dist/matterbridge.js.map +0 -1
  237. package/dist/matterbridgeAccessoryPlatform.d.ts +0 -41
  238. package/dist/matterbridgeAccessoryPlatform.d.ts.map +0 -1
  239. package/dist/matterbridgeAccessoryPlatform.js.map +0 -1
  240. package/dist/matterbridgeBehaviors.d.ts +0 -2404
  241. package/dist/matterbridgeBehaviors.d.ts.map +0 -1
  242. package/dist/matterbridgeBehaviors.js.map +0 -1
  243. package/dist/matterbridgeDeviceTypes.d.ts +0 -698
  244. package/dist/matterbridgeDeviceTypes.d.ts.map +0 -1
  245. package/dist/matterbridgeDeviceTypes.js.map +0 -1
  246. package/dist/matterbridgeDynamicPlatform.d.ts +0 -41
  247. package/dist/matterbridgeDynamicPlatform.d.ts.map +0 -1
  248. package/dist/matterbridgeDynamicPlatform.js.map +0 -1
  249. package/dist/matterbridgeEndpoint.d.ts +0 -1507
  250. package/dist/matterbridgeEndpoint.d.ts.map +0 -1
  251. package/dist/matterbridgeEndpoint.js.map +0 -1
  252. package/dist/matterbridgeEndpointHelpers.d.ts +0 -787
  253. package/dist/matterbridgeEndpointHelpers.d.ts.map +0 -1
  254. package/dist/matterbridgeEndpointHelpers.js.map +0 -1
  255. package/dist/matterbridgeEndpointTypes.d.ts +0 -166
  256. package/dist/matterbridgeEndpointTypes.d.ts.map +0 -1
  257. package/dist/matterbridgeEndpointTypes.js.map +0 -1
  258. package/dist/matterbridgePlatform.d.ts +0 -539
  259. package/dist/matterbridgePlatform.d.ts.map +0 -1
  260. package/dist/matterbridgePlatform.js.map +0 -1
  261. package/dist/matterbridgeTypes.d.ts +0 -252
  262. package/dist/matterbridgeTypes.d.ts.map +0 -1
  263. package/dist/matterbridgeTypes.js.map +0 -1
  264. package/dist/pluginManager.d.ts +0 -372
  265. package/dist/pluginManager.d.ts.map +0 -1
  266. package/dist/pluginManager.js.map +0 -1
  267. package/dist/shelly.d.ts +0 -181
  268. package/dist/shelly.d.ts.map +0 -1
  269. package/dist/shelly.js.map +0 -1
  270. package/dist/storage/export.d.ts +0 -2
  271. package/dist/storage/export.d.ts.map +0 -1
  272. package/dist/storage/export.js.map +0 -1
  273. package/dist/update.d.ts +0 -84
  274. package/dist/update.d.ts.map +0 -1
  275. package/dist/update.js.map +0 -1
  276. package/dist/utils/colorUtils.d.ts +0 -101
  277. package/dist/utils/colorUtils.d.ts.map +0 -1
  278. package/dist/utils/colorUtils.js.map +0 -1
  279. package/dist/utils/commandLine.d.ts +0 -66
  280. package/dist/utils/commandLine.d.ts.map +0 -1
  281. package/dist/utils/commandLine.js.map +0 -1
  282. package/dist/utils/copyDirectory.d.ts +0 -35
  283. package/dist/utils/copyDirectory.d.ts.map +0 -1
  284. package/dist/utils/copyDirectory.js.map +0 -1
  285. package/dist/utils/createDirectory.d.ts +0 -34
  286. package/dist/utils/createDirectory.d.ts.map +0 -1
  287. package/dist/utils/createDirectory.js.map +0 -1
  288. package/dist/utils/createZip.d.ts +0 -39
  289. package/dist/utils/createZip.d.ts.map +0 -1
  290. package/dist/utils/createZip.js.map +0 -1
  291. package/dist/utils/deepCopy.d.ts +0 -32
  292. package/dist/utils/deepCopy.d.ts.map +0 -1
  293. package/dist/utils/deepCopy.js.map +0 -1
  294. package/dist/utils/deepEqual.d.ts +0 -54
  295. package/dist/utils/deepEqual.d.ts.map +0 -1
  296. package/dist/utils/deepEqual.js.map +0 -1
  297. package/dist/utils/error.d.ts +0 -45
  298. package/dist/utils/error.d.ts.map +0 -1
  299. package/dist/utils/error.js.map +0 -1
  300. package/dist/utils/export.d.ts +0 -13
  301. package/dist/utils/export.d.ts.map +0 -1
  302. package/dist/utils/export.js.map +0 -1
  303. package/dist/utils/format.d.ts +0 -53
  304. package/dist/utils/format.d.ts.map +0 -1
  305. package/dist/utils/format.js.map +0 -1
  306. package/dist/utils/hex.d.ts +0 -89
  307. package/dist/utils/hex.d.ts.map +0 -1
  308. package/dist/utils/hex.js.map +0 -1
  309. package/dist/utils/inspector.d.ts +0 -87
  310. package/dist/utils/inspector.d.ts.map +0 -1
  311. package/dist/utils/inspector.js.map +0 -1
  312. package/dist/utils/isvalid.d.ts +0 -103
  313. package/dist/utils/isvalid.d.ts.map +0 -1
  314. package/dist/utils/isvalid.js.map +0 -1
  315. package/dist/utils/network.d.ts +0 -117
  316. package/dist/utils/network.d.ts.map +0 -1
  317. package/dist/utils/network.js.map +0 -1
  318. package/dist/utils/spawn.d.ts +0 -33
  319. package/dist/utils/spawn.d.ts.map +0 -1
  320. package/dist/utils/spawn.js.map +0 -1
  321. package/dist/utils/tracker.d.ts +0 -108
  322. package/dist/utils/tracker.d.ts.map +0 -1
  323. package/dist/utils/tracker.js.map +0 -1
  324. package/dist/utils/wait.d.ts +0 -54
  325. package/dist/utils/wait.d.ts.map +0 -1
  326. package/dist/utils/wait.js.map +0 -1
  327. package/dist/workerGlobalPrefix.d.ts +0 -25
  328. package/dist/workerGlobalPrefix.d.ts.map +0 -1
  329. package/dist/workerGlobalPrefix.js.map +0 -1
  330. package/dist/workerTypes.d.ts +0 -52
  331. package/dist/workerTypes.d.ts.map +0 -1
  332. package/dist/workerTypes.js.map +0 -1
  333. package/dist/workers.d.ts +0 -69
  334. package/dist/workers.d.ts.map +0 -1
  335. package/dist/workers.js.map +0 -1
@@ -1,25 +1,3 @@
1
- /**
2
- * @description This file contains the class MdnsReflectorClient.
3
- * @file src/dgram/mdnsReflectorClient.ts
4
- * @author Luca Liguori
5
- * @created 2025-12-25
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
- */
23
1
  import { AnsiLogger, BLUE, nt } from 'node-ansi-logger';
24
2
  import { getStringArrayParameter, hasParameter } from '../utils/commandLine.js';
25
3
  import { Mdns } from './mdns.js';
@@ -30,7 +8,7 @@ export class MdnsReflectorClient {
30
8
  verbose = hasParameter('v') || hasParameter('verbose');
31
9
  debug = hasParameter('d') || hasParameter('debug') || hasParameter('v') || hasParameter('verbose');
32
10
  silent = hasParameter('s') || hasParameter('silent');
33
- log = new AnsiLogger({ logName: 'MdnsReflectorClient', logTimestampFormat: 4 /* TimestampFormat.TIME_MILLIS */, logLevel: this.debug ? "debug" /* LogLevel.DEBUG */ : this.silent ? "notice" /* LogLevel.NOTICE */ : "info" /* LogLevel.INFO */ });
11
+ log = new AnsiLogger({ logName: 'MdnsReflectorClient', logTimestampFormat: 4, logLevel: this.debug ? "debug" : this.silent ? "notice" : "info" });
34
12
  mdnsIpv4 = new Mdns('mDNS udp4 Server', MDNS_MULTICAST_IPV4_ADDRESS, MDNS_MULTICAST_PORT, 'udp4', true, undefined, MDNS_REFLECTOR_BIND_ADDRESS_IPV4);
35
13
  mdnsIpv6 = new Mdns('mDNS udp6 Server', MDNS_MULTICAST_IPV6_ADDRESS, MDNS_MULTICAST_PORT, 'udp6', true, undefined, MDNS_REFLECTOR_BIND_ADDRESS_IPV6);
36
14
  unicastIpv4 = new Unicast('mDNS udp4 Reflector Client', 'udp4', false, undefined, MDNS_REFLECTOR_BIND_ADDRESS_IPV4);
@@ -38,14 +16,13 @@ export class MdnsReflectorClient {
38
16
  constructor() {
39
17
  this.log.logNameColor = '\x1b[38;5;97m';
40
18
  this.mdnsIpv4.log.logNameColor = '\x1b[38;5;97m';
41
- this.mdnsIpv4.log.logLevel = "warn" /* LogLevel.WARN */;
19
+ this.mdnsIpv4.log.logLevel = "warn";
42
20
  this.mdnsIpv6.log.logNameColor = '\x1b[38;5;97m';
43
- this.mdnsIpv6.log.logLevel = "warn" /* LogLevel.WARN */;
21
+ this.mdnsIpv6.log.logLevel = "warn";
44
22
  this.unicastIpv4.log.logNameColor = '\x1b[38;5;97m';
45
- this.unicastIpv4.log.logLevel = "warn" /* LogLevel.WARN */;
23
+ this.unicastIpv4.log.logLevel = "warn";
46
24
  this.unicastIpv6.log.logNameColor = '\x1b[38;5;97m';
47
- this.unicastIpv6.log.logLevel = "warn" /* LogLevel.WARN */;
48
- // Apply filters if any
25
+ this.unicastIpv6.log.logLevel = "warn";
49
26
  const filters = getStringArrayParameter('filter');
50
27
  if (filters)
51
28
  this.mdnsIpv4.filters.push(...filters);
@@ -129,4 +106,3 @@ export class MdnsReflectorClient {
129
106
  this.log.notice('mDNS Reflector Client stopped.');
130
107
  }
131
108
  }
132
- //# sourceMappingURL=mdnsReflectorClient.js.map
@@ -1,25 +1,3 @@
1
- /**
2
- * @description This file contains the class MdnsReflectorServer.
3
- * @file src/dgram/mdnsReflectorServer.ts
4
- * @author Luca Liguori
5
- * @created 2025-12-25
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
- */
23
1
  import os from 'node:os';
24
2
  import { AnsiLogger, BLUE, nt } from 'node-ansi-logger';
25
3
  import { hasParameter, getStringArrayParameter } from '../utils/commandLine.js';
@@ -31,7 +9,7 @@ export class MdnsReflectorServer {
31
9
  verbose = hasParameter('v') || hasParameter('verbose');
32
10
  debug = hasParameter('d') || hasParameter('debug') || hasParameter('v') || hasParameter('verbose');
33
11
  silent = hasParameter('s') || hasParameter('silent');
34
- log = new AnsiLogger({ logName: 'MdnsReflectorServer', logTimestampFormat: 4 /* TimestampFormat.TIME_MILLIS */, logLevel: this.debug ? "debug" /* LogLevel.DEBUG */ : this.silent ? "notice" /* LogLevel.NOTICE */ : "info" /* LogLevel.INFO */ });
12
+ log = new AnsiLogger({ logName: 'MdnsReflectorServer', logTimestampFormat: 4, logLevel: this.debug ? "debug" : this.silent ? "notice" : "info" });
35
13
  mdnsIpv4 = new Mdns('mDNS udp4 Server', MDNS_MULTICAST_IPV4_ADDRESS, MDNS_MULTICAST_PORT, 'udp4', true, undefined, MDNS_REFLECTOR_BIND_ADDRESS_IPV4);
36
14
  mdnsIpv6 = new Mdns('mDNS udp6 Server', MDNS_MULTICAST_IPV6_ADDRESS, MDNS_MULTICAST_PORT, 'udp6', true, undefined, MDNS_REFLECTOR_BIND_ADDRESS_IPV6);
37
15
  unicastIpv4 = new Unicast('mDNS udp4 Reflector Server', 'udp4', true, undefined, MDNS_REFLECTOR_BIND_ADDRESS_IPV4, MDNS_REFLECTOR_PORT);
@@ -41,14 +19,13 @@ export class MdnsReflectorServer {
41
19
  constructor() {
42
20
  this.log.logNameColor = '\x1b[38;5;115m';
43
21
  this.mdnsIpv4.log.logNameColor = '\x1b[38;5;115m';
44
- this.mdnsIpv4.log.logLevel = "warn" /* LogLevel.WARN */;
22
+ this.mdnsIpv4.log.logLevel = "warn";
45
23
  this.mdnsIpv6.log.logNameColor = '\x1b[38;5;115m';
46
- this.mdnsIpv6.log.logLevel = "warn" /* LogLevel.WARN */;
24
+ this.mdnsIpv6.log.logLevel = "warn";
47
25
  this.unicastIpv4.log.logNameColor = '\x1b[38;5;115m';
48
- this.unicastIpv4.log.logLevel = "warn" /* LogLevel.WARN */;
26
+ this.unicastIpv4.log.logLevel = "warn";
49
27
  this.unicastIpv6.log.logNameColor = '\x1b[38;5;115m';
50
- this.unicastIpv6.log.logLevel = "warn" /* LogLevel.WARN */;
51
- // Apply filters if any
28
+ this.unicastIpv6.log.logLevel = "warn";
52
29
  const filters = getStringArrayParameter('filter');
53
30
  if (filters)
54
31
  this.mdnsIpv4.filters.push(...filters);
@@ -66,18 +43,7 @@ export class MdnsReflectorServer {
66
43
  mdns.log.error(`Error getting broadcast address: ${error.message}`);
67
44
  }
68
45
  }
69
- /**
70
- * Decode and upgrade the A and AAAA records from Docker environment to point the host machine.
71
- * Matterbridge running inside Docker Desktop containers register mDNS records with the container's IP address,
72
- * which is not reachable from outside the Docker network.
73
- * To make these services reachable, we need to upgrade the A and AAAA records using the host machine IP addresses.
74
- * The reflector server runs on the host, while mDNS advertisements come from containers.
75
- *
76
- * @param {Buffer<ArrayBufferLike>} msg - The mDNS message buffer.
77
- * @returns {Buffer<ArrayBufferLike>} The upgraded mDNS message buffer.
78
- */
79
46
  upgradeAddress(msg) {
80
- // Safety: if it's not even a DNS header, do nothing.
81
47
  if (!msg || msg.length < 12)
82
48
  return msg;
83
49
  const preferredInterfaceName = this.mdnsIpv4.interfaceName ?? this.mdnsIpv6.interfaceName;
@@ -113,7 +79,6 @@ export class MdnsReflectorServer {
113
79
  this.log.info(`**UpgradeAddress Host IPv6 for address upgrade: ${hostIpv6List.length > 0 ? hostIpv6List.join(', ') : 'N/A'}`);
114
80
  if (!hostIpv4 && hostIpv6List.length === 0)
115
81
  return msg;
116
- // Copy the message so callers can safely re-use the original buffer.
117
82
  const upgradedMsg = Buffer.from(msg);
118
83
  const qdCount = upgradedMsg.readUInt16BE(4);
119
84
  const anCount = upgradedMsg.readUInt16BE(6);
@@ -121,11 +86,9 @@ export class MdnsReflectorServer {
121
86
  const arCount = upgradedMsg.readUInt16BE(10);
122
87
  let offset = 12;
123
88
  try {
124
- // Skip questions
125
89
  for (let i = 0; i < qdCount; i++) {
126
90
  const qnameResult = this.mdnsIpv4.decodeDnsName(upgradedMsg, offset);
127
91
  offset = qnameResult.newOffset;
128
- // QTYPE + QCLASS
129
92
  offset += 4;
130
93
  if (offset > upgradedMsg.length)
131
94
  return msg;
@@ -141,9 +104,7 @@ export class MdnsReflectorServer {
141
104
  return;
142
105
  const type = upgradedMsg.readUInt16BE(offset);
143
106
  offset += 2;
144
- // class (unused)
145
107
  offset += 2;
146
- // ttl (unused)
147
108
  offset += 4;
148
109
  const rdlength = upgradedMsg.readUInt16BE(offset);
149
110
  offset += 2;
@@ -151,10 +112,10 @@ export class MdnsReflectorServer {
151
112
  const endOfRdata = rdataOffset + rdlength;
152
113
  if (endOfRdata > upgradedMsg.length)
153
114
  return;
154
- if (type === 1 /* DnsRecordType.A */ && rdlength === 4 && hostA) {
115
+ if (type === 1 && rdlength === 4 && hostA) {
155
116
  hostA.copy(upgradedMsg, rdataOffset);
156
117
  }
157
- else if (type === 28 /* DnsRecordType.AAAA */ && rdlength === 16 && hostAAAAs.length > 0) {
118
+ else if (type === 28 && rdlength === 16 && hostAAAAs.length > 0) {
158
119
  const hostAAAA = hostAAAAs[Math.min(hostAAAAIndex, hostAAAAs.length - 1)];
159
120
  hostAAAA.copy(upgradedMsg, rdataOffset);
160
121
  hostAAAAIndex++;
@@ -162,7 +123,6 @@ export class MdnsReflectorServer {
162
123
  offset = endOfRdata;
163
124
  }
164
125
  };
165
- // Walk RR sections and patch A/AAAA in-place.
166
126
  upgradeResourceRecords(anCount);
167
127
  upgradeResourceRecords(nsCount);
168
128
  upgradeResourceRecords(arCount);
@@ -265,7 +225,7 @@ export class MdnsReflectorServer {
265
225
  this.log.debug(`Notifying ipv6 client ${client.address}:${client.port} about server stopping`);
266
226
  this.unicastIpv6.send(Buffer.from('mDNS Reflector Server is stopping'), client.address, client.port);
267
227
  }
268
- await new Promise((resolve) => setTimeout(resolve, 100)); // Wait a bit to allow messages to be sent
228
+ await new Promise((resolve) => setTimeout(resolve, 100));
269
229
  const promises = [];
270
230
  promises[0] = new Promise((resolve) => {
271
231
  this.mdnsIpv4.once('closed', () => resolve());
@@ -291,4 +251,3 @@ export class MdnsReflectorServer {
291
251
  this.log.notice('mDNS Reflector Server stopped.');
292
252
  }
293
253
  }
294
- //# sourceMappingURL=mdnsReflectorServer.js.map
@@ -1,28 +1,5 @@
1
- /**
2
- * @description This file contains the definitions for the mDNS reflector classes.
3
- * @file src/dgram/mdnsReflectorTypes.ts
4
- * @author Luca Liguori
5
- * @created 2025-12-25
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
- */
23
1
  export const MDNS_REFLECTOR_BIND_ADDRESS_IPV4 = '0.0.0.0';
24
2
  export const MDNS_REFLECTOR_BIND_ADDRESS_IPV6 = '::';
25
- export const MDNS_REFLECTOR_ADDRESS = 'localhost'; // Use 'localhost' to support both IPv4 and IPv6 and to avoid issues in Docker with EPERM
3
+ export const MDNS_REFLECTOR_ADDRESS = 'localhost';
26
4
  export const MDNS_REFLECTOR_HOST_DOCKER = 'host.docker.internal';
27
5
  export const MDNS_REFLECTOR_PORT = 15353;
28
- //# sourceMappingURL=mdnsReflectorTypes.js.map
@@ -1,29 +1,5 @@
1
- /**
2
- * @description This file contains the class Multicast.
3
- * @file multicast.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
- */
23
1
  import os from 'node:os';
24
- // AnsiLogger imports
25
2
  import { BLUE, CYAN, db, RED, YELLOW } from 'node-ansi-logger';
26
- // Dgram imports
27
3
  import { Dgram } from './dgram.js';
28
4
  export const MDNS_MULTICAST_IPV4_ADDRESS = '224.0.0.251';
29
5
  export const MDNS_MULTICAST_IPV6_ADDRESS = 'ff02::fb';
@@ -31,37 +7,18 @@ export const MDNS_MULTICAST_PORT = 5353;
31
7
  export const COAP_MULTICAST_IPV4_ADDRESS = '224.0.1.187';
32
8
  export const COAP_MULTICAST_IPV6_ADDRESS = 'ff02::fd';
33
9
  export const COAP_MULTICAST_PORT = 5683;
34
- /**
35
- * This class implements a multicast dgram socket.
36
- */
37
10
  export class Multicast extends Dgram {
38
11
  multicastAddress;
39
12
  multicastPort;
40
13
  outgoingInterfaceAddress;
41
14
  joinedInterfaces = [];
42
- /**
43
- * Creates an instance of Multicast.
44
- *
45
- * @param {string} name - The name of the socket.
46
- * @param {string} multicastAddress - The multicast address to join.
47
- * @param {number} multicastPort - The port number to bind to.
48
- * @param {'udp4' | 'udp6'} socketType - The type of the socket (IPv4 or IPv6).
49
- * @param {boolean | undefined} reuseAddr - Whether to allow address reuse. Defaults to true.
50
- * @param {string} [interfaceName] - The name of the network interface to bind to. If provided, the interfaceAddress will be determined based on this name if not explicitly provided.
51
- * @param {string} [interfaceAddress] - The address of the network interface to bind to. If not provided, it will be determined based on the interfaceName.
52
- * @param {string} [outgoingInterfaceAddress] - The address of the outgoing network interface. If not provided, it will use the interfaceAddress.
53
- */
54
15
  constructor(name, multicastAddress, multicastPort, socketType, reuseAddr = true, interfaceName, interfaceAddress, outgoingInterfaceAddress) {
55
16
  super(name, socketType, reuseAddr, interfaceName, interfaceAddress);
56
17
  this.multicastAddress = multicastAddress;
57
18
  this.multicastPort = multicastPort;
58
19
  this.outgoingInterfaceAddress = outgoingInterfaceAddress;
59
20
  }
60
- /**
61
- * Starts the dgram multicast socket.
62
- */
63
21
  start() {
64
- // Get the local ipv4 or ipv6 address to bind to.
65
22
  if (this.socketType === 'udp4') {
66
23
  this.log.debug(`Starting ipv4 dgram multicast socket...`);
67
24
  this.interfaceAddress = this.interfaceAddress ?? this.getIpv4InterfaceAddress(this.interfaceName);
@@ -77,11 +34,6 @@ export class Multicast extends Dgram {
77
34
  this.emit('bound', address);
78
35
  });
79
36
  }
80
- /**
81
- * Event handler for the 'listening' event. This event is emitted when the socket starts listening for datagram messages.
82
- *
83
- * @param {AddressInfo} [address] - The address info.
84
- */
85
37
  onListening(address) {
86
38
  this.log.debug(`Dgram multicast socket listening on ${BLUE}${address.family}${db} ${BLUE}${address.address}${db}:${BLUE}${address.port}${db}`);
87
39
  this.socket.setBroadcast(true);
@@ -92,46 +44,39 @@ export class Multicast extends Dgram {
92
44
  this.log.debug(`Dgram multicast socket multicast TTL set to 255`);
93
45
  this.socket.setMulticastLoopback(true);
94
46
  this.log.debug(`Dgram multicast socket multicast loopback enabled`);
95
- // Find the correct network interfaces and join the multicast group on each interface. For IPv6, we will use the scope ID if available. If not available, we will use the Unique Local Address.
96
47
  Object.entries(os.networkInterfaces()).forEach(([name, interfaces]) => {
97
48
  this.log.debug(`Dgram multicast socket processing interface ${CYAN}${name}${db}`);
98
49
  if (!interfaces)
99
50
  return;
100
51
  if (this.interfaceName && name !== this.interfaceName)
101
- return; // Only process the specified interface
52
+ return;
102
53
  let iface;
103
54
  let membershipInterface;
104
- // Find the first ipv4 interface
105
55
  const ifaceIpv4 = interfaces.find((iface) => iface.family === 'IPv4' && this.socketType === 'udp4');
106
56
  if (ifaceIpv4) {
107
57
  iface = ifaceIpv4;
108
58
  membershipInterface = ifaceIpv4.address;
109
59
  }
110
- // Find the first IPv6 Address
111
60
  const ifaceIpv6 = interfaces.find((iface) => iface.family === 'IPv6' && this.socketType === 'udp6');
112
61
  if (ifaceIpv6) {
113
62
  iface = ifaceIpv6;
114
63
  membershipInterface = ifaceIpv6.address + (ifaceIpv6.scopeid !== undefined ? (process.platform === 'win32' ? '%' + String(ifaceIpv6.scopeid) : '%' + name) : '');
115
64
  }
116
- // Find the first Unique Local Address (ULA) IPv6
117
65
  const ifaceUla = interfaces.find((iface) => iface.family === 'IPv6' && this.socketType === 'udp6' && iface.address.startsWith('fd'));
118
66
  if (ifaceUla) {
119
67
  iface = ifaceUla;
120
68
  membershipInterface = ifaceUla.address + (ifaceUla.scopeid !== undefined ? (process.platform === 'win32' ? '%' + String(ifaceUla.scopeid) : '%' + name) : '');
121
69
  }
122
- // Find the first Unique Local Address (ULA) IPv6 with prefix length /64 (netmask ffff:ffff:ffff:ffff::)
123
70
  const ifaceUla64 = interfaces.find((iface) => iface.family === 'IPv6' && this.socketType === 'udp6' && iface.address.startsWith('fd') && iface.netmask === 'ffff:ffff:ffff:ffff::');
124
71
  if (ifaceUla64) {
125
72
  iface = ifaceUla64;
126
73
  membershipInterface = ifaceUla64.address + (ifaceUla64.scopeid !== undefined ? (process.platform === 'win32' ? '%' + String(ifaceUla64.scopeid) : '%' + name) : '');
127
74
  }
128
- // Find the first Link-local IPv6 Address
129
75
  const ifaceLinkLocal = interfaces.find((iface) => iface.family === 'IPv6' && this.socketType === 'udp6' && iface.address.startsWith('fe80'));
130
76
  if (ifaceLinkLocal) {
131
77
  iface = ifaceLinkLocal;
132
78
  membershipInterface = ifaceLinkLocal.address + (ifaceLinkLocal.scopeid !== undefined ? (process.platform === 'win32' ? '%' + String(ifaceLinkLocal.scopeid) : '%' + name) : '');
133
79
  }
134
- // Add the interface address to the multicast group
135
80
  if (iface && membershipInterface) {
136
81
  try {
137
82
  this.socket.addMembership(this.multicastAddress, membershipInterface);
@@ -144,11 +89,9 @@ export class Multicast extends Dgram {
144
89
  }
145
90
  });
146
91
  let interfaceAddress = this.outgoingInterfaceAddress || this.interfaceAddress;
147
- // If the interfaceAddress is 0.0.0.0, we need to set the default outgoing multicast interface to the first found IPv4 address.
148
92
  if (!this.outgoingInterfaceAddress && this.socketType === 'udp4' && this.interfaceAddress === '0.0.0.0') {
149
93
  interfaceAddress = this.getIpv4InterfaceAddress(this.interfaceName);
150
94
  }
151
- // If the interfaceAddress is '::', we need to set the default outgoing multicast interface to '::' + the scope ID.
152
95
  if (!this.outgoingInterfaceAddress && this.socketType === 'udp6' && this.interfaceAddress === '::') {
153
96
  interfaceAddress = '::' + this.getIpv6ScopeId(this.interfaceName);
154
97
  }
@@ -157,9 +100,6 @@ export class Multicast extends Dgram {
157
100
  this.log.debug(`Dgram multicast socket multicastInterface set to ${BLUE}${interfaceAddress}${db}`);
158
101
  this.emit('ready', address);
159
102
  }
160
- /**
161
- * Stops the dgram multicast socket.
162
- */
163
103
  stop() {
164
104
  this.log.debug('Stopping dgram multicast socket...');
165
105
  this.joinedInterfaces.forEach((membershipInterface) => {
@@ -176,4 +116,3 @@ export class Multicast extends Dgram {
176
116
  this.log.debug('Stopped dgram multicast socket.');
177
117
  }
178
118
  }
179
- //# sourceMappingURL=multicast.js.map
@@ -1,54 +1,12 @@
1
- /**
2
- * @description This file contains the class Unicast.
3
- * @file unicast.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
- */
23
- // AnsiLogger imports
24
1
  import { BLUE, db } from 'node-ansi-logger';
25
- // Net imports
26
2
  import { Dgram } from './dgram.js';
27
- /**
28
- * This class implements a unicast dgram socket.
29
- */
30
3
  export class Unicast extends Dgram {
31
4
  port;
32
- /**
33
- * Creates an instance of Unicast.
34
- *
35
- * @param {string} name - The name of the socket.
36
- * @param {'udp4' | 'udp6'} socketType - The type of the socket (IPv4 or IPv6).
37
- * @param {boolean | undefined} reuseAddr - Whether to allow address reuse. Defaults to true.
38
- * @param {string} [interfaceName] - The name of the network interface to bind to. If provided, the interfaceAddress will be determined based on this name if not explicitly provided.
39
- * @param {string} [interfaceAddress] - The address of the network interface to bind to. If not provided, it will be determined based on the interfaceName.
40
- * @param {number} [port] - The port number to bind to. If not provided, it will bind to any available port.
41
- */
42
5
  constructor(name, socketType, reuseAddr = true, interfaceName, interfaceAddress, port) {
43
6
  super(name, socketType, reuseAddr, interfaceName, interfaceAddress);
44
7
  this.port = port;
45
8
  }
46
- /**
47
- * Starts the dgram unicast socket.
48
- */
49
9
  start() {
50
- // Get the local ipv4 or ipv6 interfaceAddress to bind to. If not provided and interfaceName has been provided, use the first one found.
51
- // If neither interfaceAddress nor interfaceName is provided, use undefined to bind to any available address. In this case broadcast will not work.
52
10
  if (this.socketType === 'udp4') {
53
11
  this.log.debug(`Starting ipv4 dgram unicast socket...`);
54
12
  this.interfaceAddress = this.interfaceAddress ?? (this.interfaceName ? this.getIpv4InterfaceAddress(this.interfaceName) : undefined);
@@ -58,9 +16,6 @@ export class Unicast extends Dgram {
58
16
  this.interfaceAddress = this.interfaceAddress ?? (this.interfaceName ? this.getIpv6InterfaceAddress(this.interfaceName) : undefined);
59
17
  }
60
18
  this.interfaceNetmask = this.interfaceAddress ? this.getNetmask(this.interfaceAddress) : undefined;
61
- // Bind to the local address and port:
62
- // port 0 or undefined means "assign any available port"
63
- // address 0.0.0.0 or :: means "bind to all available addresses"
64
19
  this.log.debug(`Binding dgram unicast socket to ${BLUE}${this.interfaceAddress || 'all available addresses'}${db} on port ${BLUE}${this.port || 'any available port'}${db}...`);
65
20
  this.socket.bind(this.port, this.interfaceAddress, () => {
66
21
  const address = this.socket.address();
@@ -68,33 +23,18 @@ export class Unicast extends Dgram {
68
23
  this.emit('bound', address);
69
24
  });
70
25
  }
71
- /**
72
- * Event handler for the 'listening' event. This event is emitted when the socket starts listening for datagram messages.
73
- *
74
- * @param {AddressInfo} [address] - The address info.
75
- */
76
26
  onListening(address) {
77
27
  this.log.debug(`Dgram unicast socket listening on ${BLUE}${address.family}${db} ${BLUE}${address.address}${db}:${BLUE}${address.port}${db}`);
78
28
  this.socket.setBroadcast(true);
79
29
  this.log.debug(`Dgram unicast socket broadcast enabled`);
80
30
  this.emit('ready', address);
81
31
  }
82
- /**
83
- * Event handler for the 'message' event. This event is emitted when a datagram message is received.
84
- *
85
- * @param {Buffer} msg - The message buffer.
86
- * @param {RemoteInfo} rinfo - The remote info.
87
- */
88
32
  onMessage(msg, rinfo) {
89
33
  this.log.debug(`Socket received a message from ${BLUE}${rinfo.family}${db} ${BLUE}${rinfo.address}${db}:${BLUE}${rinfo.port}${db}`);
90
34
  }
91
- /**
92
- * Stops the dgram unicast socket.
93
- */
94
35
  stop() {
95
36
  this.log.debug('Stopping dgram unicast socket...');
96
37
  this.socket.close();
97
38
  this.log.debug('Stopped dgram unicast socket.');
98
39
  }
99
40
  }
100
- //# sourceMappingURL=unicast.js.map