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>