mirror of
https://github.com/devgianlu/go-librespot.git
synced 2026-04-26 05:15:49 +03:00
[PR #74] [MERGED] Added support for AP proxy #193
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#193
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?
📋 Pull Request Information
Original PR: https://github.com/devgianlu/go-librespot/pull/74
Author: @HirbodBehnam
Created: 8/27/2024
Status: ✅ Merged
Merged: 8/29/2024
Merged by: @devgianlu
Base:
master← Head:master📝 Commits (1)
1adc78cfeat: add support for AP proxy📊 Changes
3 files changed (+11 additions, -9 deletions)
View changed files
📝
ap/ap.go(+5 -1)📝
go.mod(+3 -3)📝
go.sum(+3 -5)📄 Description
Hi
Thanks for the great project! I found your project from librespot's issue regarding invalid credentials. When I was testing your project, I realized that although the HTTP requests are proxied based on
HTTP_PROXYandHTTPS_PROXYenvironment variables, the access point does not. This is rooted in the fact that the access point dialing is done vianet.Dialwith does not obey any proxy variables.It is done here:
github.com/devgianlu/go-librespot@9da1361be0/ap/ap.go (L72-L76)However, if you use proxy package which is already in the indirect packages, you can proxy the access point connection as well through a socks5 proxy. This is done by using proxy.Dial function which automatically uses the
ALL_PROXYenvironment variable. I also used an arbitrary timeout of 30 seconds which I think is reasonable.In nutshell, now, you can set the following environment variables to fully proxy everything through a socks5 proxy server (proxy.Dial does not support HTTP proxies):
I also ran
go mod tidybefore pushing my changes that's whygo.modandgo.sumare changed.Let me know what you think!
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.