[Bug]: Android app broken when library served via reverse proxy URL #1026

Closed
opened 2026-04-24 23:46:08 +02:00 by adam · 8 comments
Owner

Originally created by @k3davis on GitHub (Aug 31, 2024).

What was the Problem?

I recently added DDNS and reverse proxy to my NAS so that in addition to http://localhost:port I can connect to audiobookshelf remotely via https://audiobookshelf.mydomain.com. This works well in the web version, but not in the Android app, where it prompts me to log in and succeeds but says "bookshelf empty".

It does seem to be connected, because it lists my libraries. And when I switch to the authors tab, all the authors are listed, which then when I switch back to the main tab it lists all of the audiobooks, except with broken cover art. When I click on one of the items it brings up all the metadata (except cover art), including any progress, and when I click "Stream" it shows a toast message "Server play request failed". Sometimes it fails one step earlier and the toast message says something like "Failed to get item from library" (not sure of the exact wording), and sometimes this causes the main screen to show "bookshelf empty" again, until I navigate back to the authors tab.

Clicking on "go to web client" opens a browser view that works with this setup.

This almost works.

Steps to Reproduce the Issue

I don't know how to reproduce this as setting up the application for access via https/reverse proxy varies by device. In my case I have a Synology NAS running DSM 7.2 and audiobookshelf configured in Container Manager and running as a docker image on port 4040. I can access it via http://synologyhostname:4040 on the local network. The NAS is set up with DDNS at myhostname.synology.me. I add a reverse proxy entry that takes source HTTPS https://audiobookshelf.myhostname.synology.me and destination HTTP http://localhost:4040. Then I configure my home router to route requests to TCP/UDP port 443 (HTTPS) to my Synology NAS.

As an experiment I added an additional reverse proxy entry for HTTP http://abtest.myhostname.synology.me to HTTP http://localhost:4040 and configured my router to send port 80 requests to my NAS. I can access the library normally at that URL via the web and web client within the app, but the app behaves in exactly the same almost-working state this way. So it doesn't seem to be related to the fact that my reverse proxy setup is using HTTPS instead of HTTP, which was a theory.

What was Expected?

The app should function normally (load images, support playback) for library URLs that are served via reverse proxy.

Phone Model

Pixel 8

Phone OS

Android 14

Audiobookshelf App Version

Android App - 0.9.76

Installation Source

Google Play Store

Additional Notes

No response

Originally created by @k3davis on GitHub (Aug 31, 2024). ### What was the Problem? I recently added DDNS and reverse proxy to my NAS so that in addition to `http://localhost:port` I can connect to audiobookshelf remotely via `https://audiobookshelf.mydomain.com`. This works well in the web version, but not in the Android app, where it prompts me to log in and succeeds but says "bookshelf empty". It does seem to be connected, because it lists my libraries. And when I switch to the authors tab, all the authors are listed, which then when I switch back to the main tab it lists all of the audiobooks, except with broken cover art. When I click on one of the items it brings up all the metadata (except cover art), including any progress, and when I click "Stream" it shows a toast message "Server play request failed". Sometimes it fails one step earlier and the toast message says something like "Failed to get item from library" (not sure of the exact wording), and sometimes this causes the main screen to show "bookshelf empty" again, until I navigate back to the authors tab. Clicking on "go to web client" opens a browser view that works with this setup. This _almost_ works. ### Steps to Reproduce the Issue I don't know how to reproduce this as setting up the application for access via https/reverse proxy varies by device. In my case I have a Synology NAS running DSM 7.2 and audiobookshelf configured in Container Manager and running as a docker image on port 4040. I can access it via `http://synologyhostname:4040` on the local network. The NAS is set up with DDNS at `myhostname.synology.me`. I add a reverse proxy entry that takes source HTTPS `https://audiobookshelf.myhostname.synology.me` and destination HTTP `http://localhost:4040`. Then I configure my home router to route requests to TCP/UDP port 443 (HTTPS) to my Synology NAS. As an experiment I added an additional reverse proxy entry for HTTP `http://abtest.myhostname.synology.me` to HTTP `http://localhost:4040` and configured my router to send port 80 requests to my NAS. I can access the library normally at that URL via the web and web client within the app, but the app behaves in exactly the same almost-working state this way. So it doesn't seem to be related to the fact that my reverse proxy setup is using HTTPS instead of HTTP, which was a theory. ### What was Expected? The app should function normally (load images, support playback) for library URLs that are served via reverse proxy. ### Phone Model Pixel 8 ### Phone OS Android 14 ### Audiobookshelf App Version Android App - 0.9.76 ### Installation Source Google Play Store ### Additional Notes _No response_
adam added the bug label 2026-04-24 23:46:08 +02:00
adam closed this issue 2026-04-24 23:46:08 +02:00
Author
Owner

@nichwall commented on GitHub (Aug 31, 2024):

Did you enable websockets in the reverse proxy?

@nichwall commented on GitHub (Aug 31, 2024): Did you enable websockets in the reverse proxy?
Author
Owner

@k3davis commented on GitHub (Aug 31, 2024):

I did to the best of my knowledge, though now that you mention it, it does show as the socket is disconnected (even via the web which otherwise looks correct). Is it possibly using ws:// links (assuming http) instead of wss://? -- admittedly I'm totally guessing at this point. (I confirmed that isn't the case.)

image

@k3davis commented on GitHub (Aug 31, 2024): I did to the best of my knowledge, though now that you mention it, it does show as the socket is disconnected (even via the web which otherwise looks correct). ~Is it possibly using `ws://` links (assuming http) instead of `wss://`? -- admittedly I'm totally guessing at this point.~ (I confirmed that isn't the case.) ![image](https://github.com/user-attachments/assets/7523d26d-a0f4-4d7f-9362-ae46d78d9ca6)
Author
Owner

@nichwall commented on GitHub (Aug 31, 2024):

That looks correct for the websocket on Synology. What server version are you running?

@nichwall commented on GitHub (Aug 31, 2024): That looks correct for the websocket on Synology. What server version are you running?
Author
Owner

@k3davis commented on GitHub (Aug 31, 2024):

The server version is 2.12.3

My connection info look like this, fwiw:

GET wss://audiobookshelf.myhostname.synology.me/socket.io/?EIO=4&transport=websocket
Connection: keep-alive, Upgrade
Upgrade: websocket

From the browser console the connection appears to be timing out.

@k3davis commented on GitHub (Aug 31, 2024): The server version is [2.12.3](https://github.com/advplyr/audiobookshelf/releases/tag/v2.12.3) My connection info look like this, fwiw: ``` GET wss://audiobookshelf.myhostname.synology.me/socket.io/?EIO=4&transport=websocket Connection: keep-alive, Upgrade Upgrade: websocket ``` From the browser console the connection appears to be timing out.
Author
Owner

@nichwall commented on GitHub (Aug 31, 2024):

This definitely sounds like a reverse proxy issue, not an ABS issue. The reason I asked about the server version is a similar issue occurs when someone is using an out of date server (by over a year) which is not compatible with the app version.

Most people who are using reverse proxies are using them because of the SSL capabilities, so https redirects to http are definitely supported by both the web client and apps.

I'm not sure what to try for debugging the Synology reverse proxy. You will get better community support on the ABS discord, but if you are able to figure it out and report your findings here again for other users who may have a similar configuration issue that work be great.

@nichwall commented on GitHub (Aug 31, 2024): This definitely sounds like a reverse proxy issue, not an ABS issue. The reason I asked about the server version is a similar issue occurs when someone is using an out of date server (by over a year) which is not compatible with the app version. Most people who are using reverse proxies are using them because of the SSL capabilities, so https redirects to http are definitely supported by both the web client and apps. I'm not sure what to try for debugging the Synology reverse proxy. You will get better community support on the ABS discord, but if you are able to figure it out and report your findings here again for other users who may have a similar configuration issue that work be great.
Author
Owner

@kuldan5853 commented on GitHub (Sep 1, 2024):

Just to add my 2 cents - I'm using an nginx proxy and the app definitely works, so yes this is probably an issue with the synology reverse proxy.

@kuldan5853 commented on GitHub (Sep 1, 2024): Just to add my 2 cents - I'm using an nginx proxy and the app definitely works, so yes this is probably an issue with the synology reverse proxy.
Author
Owner

@adepssimius commented on GitHub (Jan 17, 2025):

I also serve ABS succesfully to the android app via nginx RP.

@adepssimius commented on GitHub (Jan 17, 2025): I also serve ABS succesfully to the android app via nginx RP.
Author
Owner

@k3davis commented on GitHub (Jan 17, 2025):

Agreed; I don't think this issue has anything to do with ABS specifically. Closing.

@k3davis commented on GitHub (Jan 17, 2025): Agreed; I don't think this issue has anything to do with ABS specifically. Closing.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf-app#1026