mirror of
https://github.com/JimLiu/baoyu-skills.git
synced 2026-07-12 05:51:44 +08:00
b1f568d03d
Bun's fetch implementation has a known issue where long-lived connections through HTTP proxies (e.g., Clash, V2Ray) get their sockets closed unexpectedly, causing Google image generation requests to fail with "The socket connection was closed unexpectedly". This change adds automatic proxy detection and falls back to curl as the HTTP client when a proxy is configured (via https_proxy, http_proxy, HTTPS_PROXY, HTTP_PROXY, or ALL_PROXY environment variables). When no proxy is detected, the original fetch-based implementation is used. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>