feat(plugin): support authenticated proxy
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
Images and logs:
[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
Maybe handleSocks4 can be removed because the SOCKS4 protocol does not have proxy authentication.
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
I'll review this PR soon. Thanks for your contribution!
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.
sounds redundant, otherwise amazing job
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
Thanks!
@qiye45 Thaaaaaanks so much always looking for this feature.
i cant see transparent player plugin option, how can i activate it?
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!