Skip to content

Advertising a localhost address doesn't seem to work #33

@jangxx

Description

@jangxx

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpinned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions