Proxy Trade Republic WebSocket through configured HTTP proxy
PU
18d ago+417+417+012345678901234567890123456789-18-18-01234567890123456789
Make Trade Republic Websocket respect HTTP_PROXY.
Goal is to make it possible to put an http egress proxy before sure.
Summary by cubic
Routes Trade Republic WebSocket connections through the configured HTTP proxy so outbound traffic can go through an egress proxy. Extracts proxy resolution from External::Client into a shared HttpProxy helper.
- Establishes a
CONNECTtunnel via the HTTP proxy and falls back to a direct connection when no proxy applies. - Prefers
HTTPS_PROXYoverHTTP_PROXY, falls back when onlyHTTP_PROXYis set, honorsNO_PROXY(including wildcards), and supports proxy credentials. - Raises
ProviderUnavailablefor invalid or unsupported proxy schemes andTransientProviderErrorwhen the proxy rejects the CONNECT, times out, or closes the connection early. - Proxy configuration errors during sync no longer mark the item unhealthy; the error is recorded in sync statistics.
- Docs proxy helpers and resolution behavior, and adds tests covering proxied, rejected, and direct connections, proxy preference and bypass, and sync error handling.
Summary by CodeRabbit
Summary
- New Features
- Trade Republic connections can use HTTP proxies, including proxies that require authentication.
- Proxy settings can specify hosts that should connect directly, and proxy selection supports scheme-specific environment variables.
- Bug Fixes
- Failed proxy connections and invalid proxy settings are reported as provider availability issues.
- Direct connections now have DNS resolution and connection timeouts.
- Proxy configuration errors no longer mark an item as unhealthy during synchronization, and the error is recorded in sync statistics.