Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm compat: node-dns-sd error #28421

Open
sigmaSd opened this issue Mar 7, 2025 · 2 comments
Open

npm compat: node-dns-sd error #28421

sigmaSd opened this issue Mar 7, 2025 · 2 comments

Comments

@sigmaSd
Copy link
Contributor

sigmaSd commented Mar 7, 2025

Version: Deno 2.2.3

import mDnsSd  from 'npm:node-dns-sd'
const device_list = await mDnsSd.discover({
       name: '_adb-tls-pairing._tcp.local'
   });
console.log(device_list)
Catching error on dropMembership: {"code":"ERR_NOT_IMPLEMENTED","name":"Error"}
error: Uncaught (in promise) Error: bind EADDRINUSE 0.0.0.0:5353
    at __node_internal_captureLargerStackTrace (ext:deno_node/internal/errors.ts:93:9)
    at __node_internal_exceptionWithHostPort (ext:deno_node/internal/errors.ts:217:10)
    at node:dgram:273:20
    at Array.processTicksAndRejections (ext:deno_node/_next_tick.ts:39:15)
    at eventLoopTick (ext:core/01_core.js:174:29)
@sigmaSd
Copy link
Contributor Author

sigmaSd commented Mar 7, 2025

When I use deno apis for similar purposes, it require listenDiagram which needs --unstable-net,

Passing that in the npm pkg case doesn't change the behavior

@sigmaSd
Copy link
Contributor Author

sigmaSd commented Mar 7, 2025

This code does the same thing in case someone need it

import { browse, MulticastInterface } from "jsr:@earthstar/dns-sd";
import { DriverDeno } from "jsr:@earthstar/dns-sd/deno";

for await (
  const service of browse({
    multicastInterface: new MulticastInterface(new DriverDeno("IPv4")),
    service: {
      protocol: "tcp",
      type: "adb-tls-pairing",
    },
  })
) {
  if (service.isActive) {
    console.log(`📡 ${service.name} - ${service.host}:${service.port}`);
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant