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

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

Open
k3davis opened this issue Aug 31, 2024 · 6 comments
Open

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

k3davis opened this issue Aug 31, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@k3davis
Copy link

k3davis commented 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

@k3davis k3davis added the bug Something isn't working label Aug 31, 2024
@k3davis k3davis changed the title [Bug]: [Bug]: Android app broken when library served via reverse proxy URL Aug 31, 2024
@nichwall
Copy link
Contributor

Did you enable websockets in the reverse proxy?

@k3davis
Copy link
Author

k3davis commented 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

@nichwall
Copy link
Contributor

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

@k3davis
Copy link
Author

k3davis commented 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.

@nichwall
Copy link
Contributor

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.

@kuldan5853
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants