Proxy Trade Republic WebSocket through configured HTTP proxy

PU
18d ago
+417-18

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 CONNECT tunnel via the HTTP proxy and falls back to a direct connection when no proxy applies.
  • Prefers HTTPS_PROXY over HTTP_PROXY, falls back when only HTTP_PROXY is set, honors NO_PROXY (including wildcards), and supports proxy credentials.
  • Raises ProviderUnavailable for invalid or unsupported proxy schemes and TransientProviderError when 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.