homebridge/ciao

Advertising a localhost address doesn't seem to work

Opened this issue · 3 comments

jangxx commented

Analysis

Running this minimal example

import { getResponder } from "@homebridge/ciao";

const responder = getResponder();

const service = responder.createService({
	name: "Example Service",
	type: "http",
	port: 8080,
});


service.advertise().then(() => {
	console.log("Service advertised");
});

does not advertise the service on 127.0.0.1, even though it should. Using restrictedAddresses: [ "127.0.0.1" ] causes the service to not be advertised at all instead. I verified this both with the zeroconfServiceBrowser Screenshot 2023-08-10 015345 and the Bonjour Browser. It correctly advertises on the IPv4 and IPv6 addresses on my Ethernet card, but not on 127.0.0.1.

Expected Behavior

The service be advertised on 127.0.0.1 and ::1 (if IPv6 is not disabled). If restrictedAddresses is used it should still be advertised.

Steps To Reproduce

Just running the minimal example mentioned above is enough.

Logs

Doesn't apply

Configuration

Doesn't apply

Environment

  • OS: Windows 10 Pro 22H2
  • Software: n/a
  • Node: v18.17.1
  • npm: 9.6.7

Process Supervisor

not applicable

Additional Context

I'm not trying to use this library for homebridge, but as a generic mDNS server instead, since it seems to be the only one that supports typescript and is also not dependent on any native code.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

jangxx commented

Bump I guess? This is still a problem that affects me, and even after hacking around a bit, I still can't figure out what could be causing this or how to fix it.

afaik this is not an issue on macOS but only windows and Linux