mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 00:05:55 +03:00
[GH-ISSUE #884] Fallback when using web proxy #439
Labels
No labels
A-Alsa
SpotifyAPI
Tokio 1.0
audio
bug
can't reproduce
compilation
dependencies
duplicate
enhancement
good first issue
help wanted
high priority
imported
imported
invalid
new api
pull-request
question
reverse engineering
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librespot#439
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @MightyMrMuesli on GitHub (Nov 20, 2021).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/884
Originally assigned to: @roderickvd on GitHub.
When librespot is configured with --proxy it instantly falls back to "ap.spotify.com:443". http://apresolve.spotify.com/ returns 400. Strangely the proxy logs consistently list the call to http://apresolve.spotify.com/ a few milliseconds later than to ap.spotify.com:443.
Here's my configuration (using librespot dev build e064f27:
librespot.conf
librespot log
squid log after three restarts of librespot
@roderickvd commented on GitHub (Nov 20, 2021):
Could you try compiling from the
new-apibranch? I rewrote the access point resolver there.@MightyMrMuesli commented on GitHub (Nov 21, 2021):
No dice. Here's the librespot log:
The call to apresolve.spotify.com is now a specific URL in squid's access.log
Btw, in case it wasn't clear: Playback works fine with the fallback. I've firewalled the librespot machine so it can only communicate via proxy, no problems so far.
@roderickvd commented on GitHub (Nov 21, 2021):
I don't run a proxy and don't intend to, so this is a bit hard for me to debug.
What stands out is that
http://apresolve.spotify.com/?type=accesspoint&type=dealer&type=spclientreturns a 400 on Squid when it obviously shouldn't. Just try to open it in your web browser --when you do so via a proxy, can you confirm it loads fine? In that case can you also show the Squid log for comparison?Another thing I notice is the difference in format between
CONNECT ap.spotify.com:443andGET http://apresolve.spotify.com/, the former specifies a port and the latter doesn't, but specifies a protocol.Hope this helps you to diagnose a bit further.
@MightyMrMuesli commented on GitHub (Nov 21, 2021):
Yeah, now I feel stupid for not trying that one before...
apresolve.spotify.com doesn't accept connections with "X-Forwarded-For" in the header. My original squid configuration had "forwarded_for off" configured, which will set X-Forwarded-For to "unknown". In that case apresolve answers with "Invalid IP address provided".
I've changed the config to "forwarded_for delete" which removes the header completely and now it works:
The same with dev:
If you want to I could add a wiki page with my working squid config.
@roderickvd commented on GitHub (Nov 21, 2021):
Are you sure? Not even with
forwarded_for on?👍
@MightyMrMuesli commented on GitHub (Nov 21, 2021):
I tested it with
forwarded_for onand indeed it works. That kind of defeats the purpose of an intermediary proxy server though, so I would prefer removing the header completely.Added Behind web proxy with some more details in the wiki.
Thanks for helping me out!
@roderickvd commented on GitHub (Nov 22, 2021):
Thanks for that wiki addition, great stuff.