Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add proxy support #88

Open
awohsen opened this issue May 23, 2022 · 71 comments
Open

Add proxy support #88

awohsen opened this issue May 23, 2022 · 71 comments
Labels
enhancement New feature or request

Comments

@awohsen
Copy link

awohsen commented May 23, 2022

Is your feature request related to a problem? Please describe.
Since I can't connect to many platforms because of censorship, I always use the proxy settings; but IDK where to implement them here!

@awohsen awohsen added the enhancement New feature or request label May 23, 2022
@Jack-Chou-HZ
Copy link

same here, from China mainland.

@KRTirtho
Copy link
Owner

KRTirtho commented Jun 3, 2022

I kind of have no idea how proxy works because I never had to use it. If anyone of you are experienced with proxy & flutter please share

@momobobe
Copy link

momobobe commented Jun 5, 2022

I kind of have no idea how proxy works because I never had to use it. If anyone of you are experienced with proxy & flutter please share

https://github.com/Sangwan5688/BlackHole/search?q=proxy&type=commits, but this is http proxy only, while many users would prefer a socks one

@0x07C0
Copy link

0x07C0 commented Jul 12, 2022

Disclamer: I have no idea what I'm doing, I'm not familiar with flutter
I've made a spotube-socks5 demo, it has hardcoded local socks5 proxy. I have no idea how to add a settings menu for proxy, so I'll just leave it here in hopes that this would help. I works globally within the app.

Package used: flutter_socks_proxy [MIT license]

@awohsen
Copy link
Author

awohsen commented Aug 27, 2022

For Linux users, there is an option to run spotube using proxychains tool and it will tunnel the application through a custom proxy

@KRTirtho
Copy link
Owner

Sorry bro.. Forgot to add this feature request to Todo

@KRTirtho KRTirtho moved this to To do in Spotube Board Feb 1, 2023
@KRTirtho KRTirtho moved this to Backlog in Spotube Board Feb 1, 2023
@Be1zebub
Copy link

Be1zebub commented May 21, 2023

spotify has left my country, so im w8 so much for proxy support in spotube

I kind of have no idea how proxy works because I never had to use it. If anyone of you are experienced with proxy & flutter please share

its easy to implement proxy via http CONNECT https://en.wikipedia.org/wiki/HTTP_tunnel#HTTP_CONNECT_tunneling
idk dart lang, but there is a pseudocode example:

function http.proxyRequest(proxy, request)
	connection = http.connect(proxy.host, proxy.port, proxy.tls)

	connection.write("CONNECT", {
		["Host"] = request.host,
		["Proxy-Authorization"] = proxy.credentials
	})

	response = connection.read()

	if response and response.code == 200 then
		connection.host = request.host
		connection.port = request.port
		connection.tls = request.tls

		connection.write(request.method, request.headers, request.body)

		return connection.read()
	else
		retry with another proxy...
	end
end

@mohammadRezaeian
Copy link

hi
thanks for write this application
please if it possible set upper priority for this option
in many country spotify is block
thanks

@KRTirtho
Copy link
Owner

I'd love to add this feature but I'm just not sure how to approach it. Looking for an expert on this topic for months :)

@KRTirtho
Copy link
Owner

I think this is no longer required/valid as Spotube now uses piped API which is accessible globally

If the default server API (kavin.rocks) is not available in your region you can change it from "Settings" > "Piped Server Instance" selector
You can find which server is closer to your region in Piped Wiki

@KRTirtho KRTirtho added the invalid/out-of-scope This doesn't seem right (or out of scope) label Jun 25, 2023
@KRTirtho KRTirtho removed the status in Spotube Board Jun 25, 2023
@KRTirtho KRTirtho added wontfix / Alternatively patched This will not be worked on or it's already patched using an alternative method and removed invalid/out-of-scope This doesn't seem right (or out of scope) labels Jun 25, 2023
@KRTirtho KRTirtho moved this to Won't be possible in Spotube Board Jun 25, 2023
@Be1zebub
Copy link

Be1zebub commented Jun 25, 2023

i have no "Piped Server Instance" in settings, is this feature released?

screenshots

@KRTirtho
Copy link
Owner

It's available in nightly release

@Be1zebub
Copy link

Be1zebub commented Jun 25, 2023

login is not proxied
ok, then I tried to login with my http proxy server - i got 403 (login in browser spotify app works ok)
seems like when i try with my own proxy spotube login button still opens https://www.spotify.com/int/why-not-available/
because in browser when proxy enabled on this page i got 403 too, like in spotube login
i think its cached?

@mohammadrafigh
Copy link

Please allow using a custom Piped instance like how Libretube handles that.

@KRTirtho KRTirtho mentioned this issue Aug 25, 2023
1 task
@spl3g
Copy link

spl3g commented Aug 30, 2023

I have the 403 issue too, maybe you can make that the login instance opens in the default browser. Idk if it's possible but i think that it would solve the problem

@Be1zebub
Copy link

"login instance opens in the default browser" - yep this would allow to proxy browser http requests and pass the login stage, rn the application is just useless in countries where spotify left :(

@spl3g
Copy link

spl3g commented Aug 31, 2023

Or it will be great to give a choice between the in app browser and the cookie method (like in the pc version).

@xmha97
Copy link

xmha97 commented Oct 6, 2023

same here, from China mainland.

same here, from Iran.

@Cp0204
Copy link

Cp0204 commented Nov 21, 2023

Piped Server Instance

Screenshot_2023-11-21-12-00-12-108_oss krtirtho spotube

I can't access github in my region, reading the online Piped Server Instance fails.😂

As well as I can build my own piped server, hopefully I can customize the input server address.

@olivier2
Copy link
Contributor

Screenshot 2024-02-22 122217

@olivier2 getting build errors, maybe I will wait for the nightly release.

Did you run:
flutter pub get

The nightly only contains changes from the dev branch, but my changes are in a completely different fork.

@KRTirtho KRTirtho pinned this issue Feb 24, 2024
@KRTirtho KRTirtho removed the wontfix / Alternatively patched This will not be worked on or it's already patched using an alternative method label Feb 24, 2024
@wuyuansheng1982
Copy link

https://pastebin.com/EvaCWx2e

Attached is the terminal output from building on Windows, getting a different error message now.

How do I check out your changes? Sorry, kinda newbie here.

@sappho192
Copy link
Contributor

Hi. I've cloned proxy-setting branch and built the Windows app.

image
I set the proxy settings like above and re-run the app, but the error floods like below:

flutter: [2024-02-27 11:09:13.856050 | Catcher 2 | INFO] ClientException with SocketException: Failed host lookup: 'accounts.spotify.com' (OS Error: Cannot find the host
...
flutter: [2024-02-27 11:09:19.907781 | Catcher 2 | INFO] Failed to open https://youtube.com/unplayable.m4a?id=4mHcEo7lhHsPxUbplsXxdk&title=I%20Don't%20Care%20About%20Nothing%20-%20from%20GRAN%20TURISMO%207.
...
flutter: [2024-02-27 11:09:19.916781 | Catcher 2 | INFO] [MediaKitError] 
Failed to open https://youtube.com/unplayable.m4a?id=5Zfn8MjK6gABVJxzCgrUin&title=Life's%20Coming%20in%20Slow%20-%20from%20GRAN%20TURISMO%207.
...

The full log is log_2402271108.txt

It seems that the proxy is not applied to every internet-related functions maybe.

@orangelckc
Copy link

分享一下在macos上使用spotube+clashX 连接的解决方案:
Share my solution on Macos with spotube+clashX:

  1. clashX复制代理命令
    Copy this proxy command in clashX
    image

  2. 打开终端,粘贴命令并执行
    Open terminal and execute this command

  3. 使用命令 open /Applications/spotube.app 打开软件
    With open /Applications/spotube.app to launch spotube
    image

这样可以让spotube使用到clashX的代理
Done, and enjoy the music with proxy.

@magicdawn
Copy link

if set proxy related environment variables works, on macOS you can install https://github.com/hschmidt/EnvPane to set environment variables for all GUI apps

@KRTirtho
Copy link
Owner

Does setting these env vars actually works? If it works, I can add a Proxy section in the settings page that can be used to override these variables

@ginqus
Copy link

ginqus commented Mar 21, 2024

Same here, getting the 403 thing on android. An option to put the token manually would be nice.

@Lippiece
Copy link

Does setting these env vars actually works? If it works, I can add a Proxy section in the settings page that can be used to override these variables

Indeed, it does.

Here's my slightly edited desktop entry to launch with proxy.

  [Desktop Entry]
  Type=Application
  Name=Spotube
  Exec=env HTTP_PROXY=127.0.0.1:2334 HTTPS_PROXY=127.0.0.1:2334 /usr/bin/spotube
  Icon=/usr/share/icons/spotube/spotube-logo.png
  Comment=A music streaming app combining the power of Spotify & YouTube
  Terminal=false
  Categories=Audio;Music;Player;AudioVideo;
  MimeType=x-scheme-handler/spotify;
  DBusActivatable=false

@Mahantor
Copy link

please add proxy mode

@Mahantor
Copy link

Mahantor commented Oct 7, 2024

373544279-e7aa5341-b4c5-4612-b9e2-7a3efddc1a75.mp4

@s-b-repo
Copy link

I'd love to add this feature but I'm just not sure how to approach it. Looking for an expert on this topic for months :)

i do ethical hacking i might be able to help

@cs-nero
Copy link

cs-nero commented Oct 26, 2024

What is the state of the proxy feature now?

@Mahantor
Copy link

What is the state of the proxy feature now?

There is no such option

@developer861
Copy link

i had the same problem used tproxy in linux hope it helps

@developer861
Copy link

developer861 commented Dec 3, 2024

but why is it in the "won't be possible" in board?
it's really an essential feature for some countries :(((
(it's would be better to name it "not possible" anyway)

@dave9123
Copy link

dave9123 commented Dec 3, 2024 via email

@developer861
Copy link

Edit: It seems that it doesn't support https

it's not really needed when you run it locally

@s-b-repo
Copy link

try using proxychains on linux and for windows we might have to add it in app

@Lippiece
Copy link

try using proxychains on linux and for windows we might have to add it in app

In my case, proxychains makes it able to access Spotify API, but the tracks themselves don't load. It's tricky, it seems I need to proxy the API, but not Youtube or Invidious.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Won't be possible
Development

No branches or pull requests