Comments (8)
Awesome, that did the trick! Connecting and listening works :)
Thanks for the fast reply and implementation. Glad you noticed to set cleartextTrafficPermitted="true" tho.
After I saw how you did the implementation I looked at the other apps (e.g. jellyfin) and saw that they did the exact same thing.
from audiobookshelf-app.
Are you able to connect to the website on your phone and listen to an audiobook? The web doesn't require a socket connection to connect to the server, but it does require it to listen to an audiobook. The app requires it to connect.
On the socket.io website they have an example caddy config: https://socket.io/docs/v3/reverse-proxy/#caddy-2
I still need to add a page in the documentation for this, so if you solve the issue please follow up so I can add your solution.
from audiobookshelf-app.
Yes, I'm able to connect to the website on my phone (via https) and listen to an audiobook (tested on Firefox).
I think the certificate validation is the issue here.
I changed Caddy to proxy http (instead of https). And using the Caddy reverse proxy on http I can connect via the app. So the Caddyfile should be correct. When I change the proxy to https, it doesn't work (even when using some header_up properties).
The certificate on caddy is a self signed certificate from caddy itself, not one from let's encrypt or similar. However, the certificate is installed on my android device so the validation should still work.
from audiobookshelf-app.
What is throwing me off is that it works on the mobile browser, because the app is running the same code when it comes to making requests.
I did find one post with this same issue and the only response was to get a different certificate from LetsEncrypt or something. Working with self-signed certificates has always been a pain for me.
A lot of users have gotten this setup already over ssl, not with caddy specifically, but hopefully they can offer a better answer than I can.
from audiobookshelf-app.
Well firefox has it's own certificate storage. So it takes the validation from those instead from the android system.
So it probably is the self signed certificate. However, when added to the android trusted certificates, the app should be able to access those and validate my connection. Sadly I'm not really familiar how the implementation works. I just know that it does work on other apps (same certificate, and validations is successful). I was hoping that this would be something android would just do for you but it seems like it does. I can see why this is a pain to deal with.
It might be an option to add the option to skip the ssl validation / to accept "untrusted" certificates.
However, I would rather like my certificate to work, because it should be trusted.
from audiobookshelf-app.
This might be the issue:
According to
https://developer.android.com/training/articles/security-config#base-config
The default certification trust level is set to "system"
Defined via:
https://developer.android.com/training/articles/security-config#certificates
My certificate is added into the android system as "user" certificate.
Maybe something liek this could work:
<network-security-config>
<base-config cleartextTrafficPermitted="false">
<trust-anchors>
<certificates src="system" />
<certificates src="user" />
</trust-anchors>
</base-config>
</network-security-config>
I don't have any android development setup, so I can't test this sadly.
from audiobookshelf-app.
I included this in release v0.9.18-beta
that will be available on the play store in an hour or so. Hopefully that works.
from audiobookshelf-app.
Nice! Good find on that config, had no idea about that.
from audiobookshelf-app.
Related Issues (20)
- [Bug]: Android: Switching user issues HOT 2
- [Enhancement]: "Clips" feature for settings bookmarks and adding notes
- [Enhancement]: to speed up the start of playback HOT 2
- [Enhancement]: "What's New" pop-up
- [Bug]: Can't download audiobooks HOT 1
- [Bug]: Cast Playrate Wrong HOT 2
- [Enhancement]: Continue Playing Audiobook When Casting
- [Enhancement]: Swipe-to-refresh in main tabs
- [Enhancement]: Auto-duck currently playing media when notification is received HOT 1
- [Enhancement]: Car mode HOT 5
- [Enhancement]: Pause, and alert, on muted volume
- [Bug]: Intermittent listening session sync issues HOT 2
- [Enhancement]: Allow streaming podcasts directly from source to the app, without downloading to server HOT 2
- [Enhancement]: Bookshelf loading indicators as toast notifications
- [Enhancement]: Better control over what information is displayed on Bluetooth screen
- [Bug]: Seek times are too short HOT 1
- [Bug]: Autosleep timer engaging outside of set time. HOT 3
- [Enhancement]: Shake to rewind HOT 7
- [Enhancement]: Change "Lock Player" behaviour HOT 8
- [Bug]: Cannot open downloaded epub files HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from audiobookshelf-app.