mirror of
https://github.com/jarrodwatts/claude-hud.git
synced 2026-04-26 14:02:40 +00:00
* fix(usage-api): do not return socket from createConnection in proxy tunnel agent Node.js _http_agent.js calls `oncreate(null, newSocket)` immediately when createConnection returns a truthy value, which causes the HTTP request to be written directly to the raw proxy socket before the CONNECT handshake completes. Proxies like Clash reject this with 400 Bad Request, surfacing as persistent 403/network errors in the Usage display. Return undefined instead so the socket is only delivered via the async callback after the CONNECT tunnel + TLS handshake succeeds. Fixes proxy CONNECT failures with Clash and similar HTTP proxies. * test(usage-api): cover proxy CONNECT request ordering --------- Co-authored-by: Jarrod Watts <jarrod@cubelabs.xyz>