mirror of
https://github.com/devgianlu/go-librespot.git
synced 2026-04-25 21:05:47 +03:00
[GH-ISSUE #291] AP Port on restricted Networks #175
Labels
No labels
bug
enhancement
pull-request
spotify-side
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/go-librespot#175
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 @pimmelkopter on GitHub (Feb 24, 2026).
Original GitHub issue: https://github.com/devgianlu/go-librespot/issues/291
Hello guys,
I've recently switched from GioF71/librespot-docker to go-librespot. I'm missing the "AP-PORT" config.
apresolve/resolve.go asks https://apresolve.spotify.com/ for aps - spotify answers with a json, that always puts Urls with Port "4070" first. This means when this port is not working on the network you have to wait for the connection to timeout before it tries contacting an Url with port 80 or 443.
A config variable setting the preferred AP-Port and then filtering or resorting the apresolve answer would help heaps!
Im not experienced in Go, vibecoding suggested adding a func:
func filterPort(addrs []string, port string) []string { var filtered []string for _, addr := range addrs { if _, p, err := net.SplitHostPort(addr); err == nil && p != port { filtered = append(filtered, addr) } } if len(filtered) == 0 { return addrs } return filtered }and replacing the r.endpoints like that: "r.endpoints[endpointTypeAccesspoint] = filterPort(respJson.Accesspoint, "4070")"
But I'm pretty sure that not the best way
Would love if changing preferred Ap Port would get implemented once theres time for it. thank you so much!