flecs icon indicating copy to clipboard operation
flecs copied to clipboard

feat(plugin): support authenticated proxy

Open qiye45 opened this issue 9 months ago • 6 comments

Added a new plugin to support authenticated proxy.

The auth-proxy-adapter plugin will start a local unauthenticated proxy server (default socks5://127.0.0.1:4545) that forwards requests to an authenticated proxy server configured in the application settings, supporting proxy in the format socks5://username:password@your_server_ip:port.

When enabled, the plugin intercepts app.commandLine.appendSwitch('proxy-server', proxyToUse) and changes the application's proxy to use the local proxy server.

Fixes #743

qiye45 avatar Apr 01 '25 13:04 qiye45

Images and logs:

Screenshot 2025-04-01 160811 image

[YTMusic] Plugin "auth-proxy-adapter::menu" loaded
[YTMusic] ===========================================
[YTMusic] [Auth-Proxy-Adapter] SOCKS proxy enabled at 127.0.0.1:4545
[YTMusic] [Auth-Proxy-Adapter] Using upstream proxy: socks5://test:[email protected]:7891
[YTMusic] ===========================================
[YTMusic] [SOCKS5] Request to connect to music.youtube.com:443
[YTMusic] [SOCKS5] Request to connect to googleads.g.doubleclick.net:443
[YTMusic] [SOCKS5] Request to connect to www.google.com:443
[YTMusic] [SOCKS5] Request to connect to static.doubleclick.net:443

qiye45 avatar Apr 01 '25 13:04 qiye45

Maybe handleSocks4 can be removed because the SOCKS4 protocol does not have proxy authentication.

qiye45 avatar Apr 02 '25 13:04 qiye45

Maybe handleSocks4 can be removed because the SOCKS4 protocol does not have proxy authentication.

I removed handleSocks4 and the application imported the ‘socks’ package because it needed to turn on the socket local server to forward requests

qiye45 avatar Apr 03 '25 13:04 qiye45

I'll review this PR soon. Thanks for your contribution!

JellyBrick avatar Apr 16 '25 14:04 JellyBrick

My only nitpick would be the backend/index.ts only existing to re-export everything from backend/main.ts, instead of just having one backend/index.ts that exports everything directly.

image

sounds redundant, otherwise amazing job

ArjixWasTaken avatar Apr 21 '25 23:04 ArjixWasTaken

I refer to the structure of the backend in the api-server plugins, maybe the api-server plugins have the same problem

https://github.com/th-ch/youtube-music/blob/master/src/plugins/api-server/backend/index.ts

I merged the main.js to index.js

qiye45 avatar Apr 22 '25 05:04 qiye45

Thanks!

JellyBrick avatar May 10 '25 17:05 JellyBrick

@qiye45 Thaaaaaanks so much always looking for this feature.

xorud4277 avatar Aug 25 '25 13:08 xorud4277

i cant see transparent player plugin option, how can i activate it?

jorgeobnd avatar Sep 16 '25 00:09 jorgeobnd

i cant see transparent player plugin option, how can i activate it?

There's wrong link in release notes for transparent mode. Here's correct one https://github.com/th-ch/youtube-music/pull/3529

https://github.com/th-ch/youtube-music/pull/3529#issuecomment-3084582265

The plugin is now fully removed on non-windows devices and the config is only touched after the plugin was enabled. Let me know if you want anything else adapted!

Eugene-Musika avatar Sep 17 '25 13:09 Eugene-Musika