owntone / owntone-server

Linux/FreeBSD DAAP (iTunes) and MPD audio server with support for AirPlay 1 and 2 speakers (multiroom), Apple Remote (and compatibles), Chromecast, Spotify and internet radio.
https://owntone.github.io/owntone-server
GNU General Public License v2.0
2.07k stars 236 forks source link

Web Player Forbidden when using hostname - iOS #606

Closed cdlenfert closed 3 years ago

cdlenfert commented 6 years ago

Until the past couple of months (maybe more recent) I've been able to access the Web Player from Chrome or Safari on iOS 9 using the hostname http://forked-daapd.local:3689/#/. I primarily used Chrome 63.0.3239.73 (released Dec 5, 2017). Now however when I access from either browser the page gives a "Forbidden" message.

I can access the web player by using the IP address of my server (Pi 3b) "192.168.0.38:3689/#/". I can also access the web player from any Mac on my network via the hostname (so it's not a network wide issue). I'd prefer to be able to use the hostname because I have a forked-daapd server at home and at work, on different IPs 10.1 vs 192.168, and this allows me to access either from the browser by simply refreshing the page.

ejurgensen commented 6 years ago

If the simplest explanation is the true one, then it is that you have two instances of forked-daapd running on your network. They will both try to register forked-daapd.local as a DNS alias (CNAME), and iOS happens to choose the "wrong" instance when it resolves the name.

However, how name resolution takes place on your phone is of course hard for me to say. There might be some tools/apps out there that can show you what ip address forked-daapd.local gets resolved to.

cdlenfert commented 6 years ago

In this case the two instances of forked-daapd are on different networks (Work and Home). I've also seen that Safari on Mac OS High Sierra hits a 403 Forbidden error, but Chrome has no issue (mac desktop version).

I it's possible it's a DNS caching issue, but I'm not sure how to clear that cache on my home network, or what services can show what address is being pointed to on a local network (though I'm sure there's something)

cdlenfert commented 5 years ago

What I discovered is that when I disabled IPV6 in the forked-daapd.conf file, I was immediately able to connect via the hostname from Safari (on Mac and iOS).

ejurgensen commented 5 years ago

Thanks for the update. Was your phone's ipv6 address in the trusted networks range? Otherwise I suppose that would explain the issue.

cdlenfert commented 5 years ago

To be honest I don't understand how IPV6 addresses are assigned to know if there's a consistent pattern to put all devices on my network it in the trusted range. Is the common piece the first 4 characters? I know the devices also have IPv4 addresses assigned, but I don't understand why Safari (mac and ios) prioritizes the IPv6 address when accessing forked-daapd's web interface via it's hostname "forked-daapd.local" but not when using the IP address of the forked-daapd server (which works). It's pretty obvious it's in the behavior of the Safari browser since hostnames work with Chrome on the same devices.

ejurgensen commented 3 years ago

Closing this since it is old and doesn't appear to be a general issue