Fix HTTP proxy URL parsing for wss:// WebSocket URLs (#3168)
authorChris <chris@sicmedia.net>
Sun, 15 Feb 2026 17:32:54 +0000 (11:32 -0600)
committerGitHub <noreply@github.com>
Sun, 15 Feb 2026 17:32:54 +0000 (12:32 -0500)
commit2464131f35f7f41cb0a814919d1d829f5c4edebb
tree14d402dd2e2c3e3cefa777be7b023f3bfc378be6
parent6385ab565acee763f390057dbd38fd5c65718960
Fix HTTP proxy URL parsing for wss:// WebSocket URLs (#3168)

* Fix HTTP proxy URL parsing for wss:// WebSocket URLs

The HTTP proxy handler constructed the local HTTP URL by stripping
"ws://" from local_ws_url with a simple string replace. When the
server uses SSL, local_ws_url is "wss://..." which didn't match the
replace, producing a broken URL like "http://wss:/imageproxy?..." and
causing all proxy requests to fail with DNS resolution errors.

Use urllib.parse.urlparse instead, which correctly handles both ws://
and wss:// schemes.

* Move urlparse import to top-level to fix PLC0415 lint error

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
music_assistant/controllers/webserver/remote_access/gateway.py