Closed coolaj86 closed 9 years ago
I think routers are sending announcements to multicast 1900 port. So yeah, it MUST be used.
So they don't respond to the M-SEARCH, but rather broadcast?
So, to your knowledge, there's no method for having two applications listening for SSDP messages on the same machine?
@coolaj86 I'm afraid I don't know this details anymore :) I was working on this thing quite long time ago, sorry!
Hey, I dove into this a bit and found that the responses to multicast requests go to whichever port the request came from, as I had initially thought.
See
I'll put in a pull request to make this dynamic.
I've tested this on 3 different routers with 3 different firmwares. I'm pretty confident about it.
Nice!
In your code you source port 1900 explicitly for the SSDP search for the gateway. Part of what I'm trying to determine empirically with https://github.com/indutny/node-nat-upnp/issues/10 is whether that's arbitrary or if 1900 MUST be used as the source port for SSDP to work.
Sending to port 1900 as a requirement makes sense, but I thought UDP responses go back to the port number in the message received by the router.