Code Monkey home page Code Monkey logo

Comments (5)

pipex avatar pipex commented on June 30, 2024 5

If anyone is still wondering about this after one year like me :p

It seems that the latest version of the package adds a bind to options that is used as address in the socket.bind() call. Setting it to 0.0.0.0 seems to fix the problem.

from multicast-dns.

nriley avatar nriley commented on June 30, 2024

I ran into something similar in a situation where I did need to use options.interface. options.interface is used in two places β€” I am not sure it needs to be used in both.

It is used not only to override the default interface (automatic selection of default interface does not do great in complex network environments β€”Β at least in my case it generally picks the wrong interface) but also to bind. If I do specify an interface I get EADDRINUSE, I guess because I also have mDNSResponder running. I ended up just removing the reference to opts.interface from bind and it seems to work just fine β€” dns-sd shows me that multicast-dns has registered on the correct interface and bind works just as it did if I hadn't specified options.interface.

The change I made was specifically to comment out opts.interface here:

    socket.bind(port, undefined /* opts.interface */, function () {

from multicast-dns.

RangerMauve avatar RangerMauve commented on June 30, 2024

I just ran into this issue and @nriley 's solution resolved it.

@mafintosh Would you be open to a PR that adds a new localAddress option which will be used in .bind() instead of opts.interface? This would be a major version change.

from multicast-dns.

pascalStm avatar pascalStm commented on June 30, 2024

I also have a problem that, if I parameter interface with my ip address to select the right interface, I receive multicast udp packets with this address, I must remove "opts.interface" from the bind command to receive all multicast udp packets of all my clients

by putting "ip" instead of "opts.interface" it works for the multicast

from multicast-dns.

ke4nec avatar ke4nec commented on June 30, 2024

If anyone is still wondering about this after one year like me :p

It seems that the latest version of the package adds a bind to options that is used as address in the socket.bind() call. Setting it to 0.0.0.0 seems to fix the problem.

Thanks!
require("multicast-dns")({bind: "0.0.0.0", interface:"192.168.1.1"});

from multicast-dns.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.