kaaholst / android-squeezer

Remote control for your Logitech Media Server ("Squeezeserver" etc) and players.
Apache License 2.0
75 stars 15 forks source link

Squeezer unable to connect via reverse proxy using HTTPS #757

Open aloneagainor opened 2 years ago

aloneagainor commented 2 years ago

When I attempt to connect to my LMS instance directly on port 9000 I am able to connect successfully.

When I connect via my reverse proxy on port 80 the connection is also successful, however when I connect via the reverse proxy on port 443 using SSL, Squeezer is unable to connect to the LMS instance, and gives me the message 'Connection Failed.' I've tried using both these syntaxes for the server name - lmsserver.domain.net:443 and https://lmsaddress.domain.net

I am able to connect successfully via the reverse proxy over HTTPS using a web browser.

The reverse proxy is running NGINX and is proxying requests to http://lmsaddress:9000

I am running version 8.2.0 of LMS and version 2.2.9 of Squeezer.

Please let me know if any other information/logs are required or if I'm doing something that's incorrectly.

Also, just a quick note to say thanks for developing Squeezer! It's a really great piece of software.

kaaholst commented 2 years ago

I managed to reproduce behaviour resembling this, using a setup involving access via mobile network and VPN. Being able to reproduce I was then able to make fix for the issue. It's a general reliability fix for communication between Squeezer and LMS, so it may fix your setup also.

Please try this apk.

When you are done testing, you may continue to use this apk, it will automatically be updated when an new version is released.

If this doesn't work logs would be helpful. However getting logs from an Android is not easy, but if know how to use logcat, then please post the log entries for the Squeezer app around the time of the issue.

aloneagainor commented 2 years ago

Apologies for the delay in replying on this. I've been in the process of changing jobs and I've not had a lot of free time.

Thanks for investigating this. I tried the new APK that you provided but it's still failing to connect with the same message. I tried a couple of different server address formats.

I'll post some logs as soon as I figure out how to use logcat.

aloneagainor commented 2 years ago

I've managed to get the logs for Squeezer when I replicated the issue. I've redacted the username and domain name. The formats that I tried were: https://music.redacteddomain.org https://music.redacteddomain.org:443 music.redacteddomain.org:443

If you need any more logs, please let me know.

Cheers squeezer_issue757.log .

viertelb commented 2 years ago

Not sure if it helps, but since I also use NGINX when I am not at home:

I am able to connect by setting the app to MYDOMAIN.DE:PORT and then use username and password to connect. As far as I remember I forward from the external port to the internal HTTPS of LMS and NGINX uses the provided password to log in.

However, this connection is not stable. I get thrown out very fast. Not sure if this has something to do with a firewall on my side. In the past I was able to do some testing on the app this way, though.

I saw that you added logging in CometClient after he added his log. Those are the according lines from my logcat:

2022-05-24 09:10:33.406 13644-13692/uk.org.ngo.squeezer W/CometClient: Unsuccessful message on connect channel: {"failure":{"exception":"java.util.concurrent.TimeoutException","message":{"clientId":"3778b6be","advice":{"timeout":0},"channel":"/meta/connect","id":"8","connectionType":"streaming"},"connectionType":"streaming"},"channel":"/meta/connect","id":"8","successful":false}
2022-05-24 09:11:12.172 13644-13739/uk.org.ngo.squeezer W/CometClient: Unsuccessful message on connect channel: {"failure":{"exception":"java.util.concurrent.TimeoutException","message":{"clientId":"5e551453","advice":{"timeout":0},"channel":"/meta/connect","id":"30","connectionType":"streaming"},"connectionType":"streaming"},"channel":"/meta/connect","id":"30","successful":false}
2022-05-24 09:11:25.967 13644-13754/uk.org.ngo.squeezer W/CometClient: Unsuccessful message on connect channel: {"failure":{"exception":"java.util.concurrent.TimeoutException","message":{"clientId":"a6c07c40","advice":{"timeout":0},"channel":"/meta/connect","id":"40","connectionType":"streaming"},"connectionType":"streaming"},"channel":"/meta/connect","id":"40","successful":false}
2022-05-24 09:11:36.634 13644-13798/uk.org.ngo.squeezer W/CometClient: Unsuccessful message on connect channel: {"failure":{"exception":"java.util.concurrent.TimeoutException","message":{"clientId":"a54afeb2","advice":{"timeout":0},"channel":"/meta/connect","id":"81","connectionType":"streaming"},"connectionType":"streaming"},"channel":"/meta/connect","id":"81","successful":false}

Edit: If you want to setup NGINX to test I can provide config files. I run it on the same Raspberry Pi where LMS is located.