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

Unexpected IP Address In SSDP Server Advertising #102

Open
cjames9001 opened this issue Nov 21, 2020 · 0 comments
Open

Unexpected IP Address In SSDP Server Advertising #102

cjames9001 opened this issue Nov 21, 2020 · 0 comments

Comments

@cjames9001
Copy link

cjames9001 commented Nov 21, 2020

I've created an SSDP server and I've given it a specific location, however the advertise-alive has messages with the expected ip of 172.16.1.47, but there are also unexpected messages being broadcast of 169.254.204.77.

This is running on a raspberry pi, I recently upgraded all my packages on the box, so this may be broken as a result of that occurring. Can someone help me understand why this isn't using the 172 address for every message? The client I'm communicating with is always picking up the wrong ip address (169.254.204.77) and then unable to communicate with my device at the correct ip address (172.16.1.47)

Here is the snippet of code for my server:

var SSDP = require('node-ssdp').Server
  , server = new SSDP({
          location: '172.16.1.47:8080/ssdp/device-desc.xml',
          udn: 'uuid:6b36a922-3d85-477e-8ec9-d87f415fc0b6'
  })

server.addUSN('urn:schemas-upnp-org:device:MyDevice:1')

server.on('advertise-alive', function (heads) {
  console.log('advertise-alive', heads)
})

server.on('advertise-bye', function (heads) {
  console.log('advertise-bye', heads)
})

// start server on all interfaces
server.start()
  .catch(e => {
    console.log('Failed to start server:', e)
  })
  .then(() => {
    console.log('Server started.')
  })

Here is the output I am getting:

advertise-alive { HOST: '239.255.255.250:1900',
  NT: 'urn:schemas-upnp-org:device:MyDevice:1',
  NTS: 'ssdp:alive',
  USN:
   'uuid:6b36a922-3d85-477e-8ec9-d87f415fc0b6::urn:schemas-upnp-org:device:MyDevice:1',
  'CACHE-CONTROL': 'max-age=1800',
  SERVER: 'node.js/10.21.0 UPnP/1.1 node-ssdp/4.0.0',
  LOCATION: 'http://169.254.204.77:8080/ssdp/device-desc.xml' }          //WHERE IS THIS COMING FROM?!
advertise-alive { HOST: '239.255.255.250:1900',
  NT: 'uuid:6b36a922-3d85-477e-8ec9-d87f415fc0b6',
  NTS: 'ssdp:alive',
  USN: 'uuid:6b36a922-3d85-477e-8ec9-d87f415fc0b6',
  'CACHE-CONTROL': 'max-age=1800',
  SERVER: 'node.js/10.21.0 UPnP/1.1 node-ssdp/4.0.0',
  LOCATION: 'http://169.254.204.77:8080/ssdp/device-desc.xml' }            //WHERE IS THIS COMING FROM?!
advertise-alive { HOST: '239.255.255.250:1900',
  NT: 'urn:schemas-upnp-org:device:MyDevice:1',
  NTS: 'ssdp:alive',
  USN:
   'uuid:6b36a922-3d85-477e-8ec9-d87f415fc0b6::urn:schemas-upnp-org:device:MyDevice:1',
  LOCATION: '172.16.1.47:8080/ssdp/device-desc.xml',
  'CACHE-CONTROL': 'max-age=1800',
  SERVER: 'node.js/10.21.0 UPnP/1.1 node-ssdp/4.0.0' }
advertise-alive { HOST: '239.255.255.250:1900',
  NT: 'uuid:6b36a922-3d85-477e-8ec9-d87f415fc0b6',
  NTS: 'ssdp:alive',
  USN: 'uuid:6b36a922-3d85-477e-8ec9-d87f415fc0b6',
  LOCATION: '172.16.1.47:8080/ssdp/device-desc.xml',                        //This is what I am expecting
  'CACHE-CONTROL': 'max-age=1800',
  SERVER: 'node.js/10.21.0 UPnP/1.1 node-ssdp/4.0.0' }
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