evandcoleman / node-appletv

A node module for interacting with an Apple TV (4th-generation or later) over the Media Remote Protocol.

Home Page:https://evandcoleman.github.io/node-appletv/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Connections cannot be made when IPv6 addresses are used along-side IPv4

lprhodes opened this issue · comments

If an IPv6 address has taken priority then no connection to the Apple TV can be made.

My current work-around is to prioritise the IPv4 address like such:

    if (device.service.addresses.length > 0) {
      const addresses = device.service.addresses.filter(address => address.includes('.'));
      device.address = addresses[0];
    }

but this obviously won't work if IPv4 is disabled on the router completely.

I am seeing each apple tv on my network appear twice with different pairing id for each.

When I examine device.service.addresses, I am only seeing an array of ONE IPv4 address. For the duplicates, the same IPv4 is in each array (that is, the duplicates have array of the same IP).

When I run avahi-browse, I see each device show up twice, but one as IPv6, and one as IPv4. I will mess with this some more to see if I can determine which of the two to use to connect.

If an IPv6 address has taken priority then no connection to the Apple TV can be made.

My current work-around is to prioritise the IPv4 address like such:

    if (device.service.addresses.length > 0) {
      const addresses = device.service.addresses.filter(address => address.includes('.'));
      device.address = addresses[0];
    }

but this obviously won't work if IPv4 is disabled on the router completely.

Which file and line did you add that code to?

I'm facing the "No Apple TVs found on the network. Try again." issue

Fixed in 1.0.11

Thanks!