I’ve set up Plexamp headlessly on my Raspberry Pi 4, and everything is running smoothly when accessing its UI via HTTP using either the device’s IP address or the local DNS name. However, I’ve encountered a couple of issues:
Direct access using HTTPS results in an “ERR_CONNECTION_CLOSED” error.
When I route the connection through a Traefik reverse proxy, even after integrating an SSL certificate, I receive a “Bad Gateway” error.
Does anyone have experience configuring Plexamp to work correctly with SSL and through a reverse proxy? Any guidance or specific configurations that might help resolve these issues would be greatly appreciated!
As far as I know, Plexamp doesn’t accept TLS connections on port 32500 for the UI (it doesn’t publish an HTTPS resource to Plex’s servers). So the last leg would need to be via a local reverse proxy on-premises terminating the TLS (HTTPS) connection and then passing it via HTTP to headless Plexamp.
I’m curious what the use case is though. Headless Plexamp is generally used to play audio to locally-connected audio equipment, presumably from your local network. If you’re remote, I’d think you would use one of the other Plexamp clients (iOS, Android, macOS, Windows, Linux). What’s the purpose of connecting to Plexamp headless via HTTPS? It’s not a server per se, rather a client to your Plex Media Server which is administered/controlled via a web UI.
I’m exploring a centralized solution for controlling music in tandem with my smart home controls. My initial thought was to integrate Plexamp’s UI into a Home Assistant dashboard. However, given that my Home Assistant runs on a TLS connection, it restricts the embedding of non-TLS websites.
Indeed, a lack of imagination on my part. I love to learn of new use cases. Thanks for that!
Thanks for clarifying. I’ve played with Home Assistant a bit, mainly getting it to dim Philips Hue lights when starting video playback and raising them again on pause/stop, but nothing with music in general or Plexamp specifically.
Is your Traefik reverse proxy hosted locally? If so, it should be configurable to completely abstract the HTTP-only nature of Plexamp from HA. I know Nginx could, so I’d think Traefik could as well. I might be able to test with Nginx…
Yes, Traefik is indeed running inside a Docker container on my NAS.
I’ve managed to resolve the issue. It appears the problem was network-related: the Raspberry Pi was on a separate subnet, which prevented Traefik from accessing it.
I can now access the UI via the reverse proxy, but playback isn’t working. It displays the error message “Couldn’t start playback.” However, when I access the UI directly using the IP address, everything functions correctly.
Same problem using nginx. I looked at the inspector in Firefox, and see a ton of 'Blocked loading mixed active content “http://x.x.x.x:32500/resources” ', followed by a link to Learn More. There are entries for every interface/IP the container can see.
I think what’s going on is that the https page is pulling the Player data from the http URL, and the browser is blocking it due to mixed http/https content.
I found in the settings file (~/.local/share/Plexamp/Settings/%40Plexamp%3Aresources (at the end) where it looks like these entries are hard coded references to the IP addresses over http. I tried manually changing/adding a https URL, but it gets overwritten.
I also saw some CORS errors, but I’m thinking the mixed-content issue is the main one.