mirror of
https://github.com/koala73/worldmonitor.git
synced 2026-05-10 17:22:01 +02:00
* refactor: consolidate 5 proxy tunnel implementations into _proxy-utils.cjs 5 near-identical HTTP CONNECT proxy tunnel implementations (3 in ais-relay.cjs, 1 in _seed-utils.mjs, 1 in seed-military-flights.mjs) consolidated into two shared functions in _proxy-utils.cjs: - proxyConnectTunnel(): low-level CONNECT + TLS wrapping, returns socket - proxyFetch(): high-level fetch with decompression, custom headers, POST support, timeout All consumers now call the shared implementation: - _seed-utils.mjs httpsProxyFetchRaw: 75 lines -> 6 lines - ais-relay.cjs ytFetchViaProxy: 40 lines -> 5 lines - ais-relay.cjs _openskyProxyConnect: 35 lines -> 8 lines - ais-relay.cjs inline Dodo CONNECT: 25 lines -> 10 lines - seed-military-flights.mjs proxyFetchJson: 70 lines -> 14 lines Also wires weather alerts proxy fallback (fixes STALE_SEED health crit). Net: -104 lines. Resolves the TODO at _seed-utils.mjs:311. * fix(proxy): default tls=true for bare proxy strings parseProxyConfig returned no tls field for bare-format proxies (user:pass@host:port and host:port:user:pass). proxyConnectTunnel checked proxyConfig.tls and used plain TCP when it was undefined, breaking connections to Decodo which requires TLS. Only http:// URLs should use plain TCP. * fix(proxy): timeout covers full response, pass targetPort through - Move clearTimeout from header arrival to stream end, so a server that stalls after 200 OK headers still hits the timeout - Make targetPort configurable in proxyConnectTunnel (was hardcoded 443), pass through from _openskyProxyConnect
7.2 KiB
7.2 KiB