2 Commits
Author SHA1 Message Date
Jason Xu d04ff337d7 feat(upstream): disguise free-model traffic as the Bun runtime
Both official OpenCode clients (1.x and 2.x) run on Bun, but the gateway
reached /zen and /inference through net/http, whose Go ClientHello, HTTP/2
and header layout no Bun client produces.

- Add httpx.BunTransport: Bun 1.4.3's BoringSSL ClientHello via uTLS
  (JA4 t13d1713h1, X25519MLKEM768, http/1.1-only ALPN), HTTP/1.1 with
  Bun fetch's header order and spelling, and gzip/deflate/br/zstd
  decoding that streams SSE incrementally.
- Support direct, HTTP/HTTPS CONNECT and SOCKS5 proxies with auth;
  proxy failures keep the net/http proxyconnect / socks connect shape so
  proxy health classification is unchanged.
- Pool idle connections per host, drop ones the server closes while
  idle, and retry once when a reused connection is dropped before the
  first response byte.
- Route only free-model traffic on the /zen and /inference lanes
  (anonymous, Zen key and availability probes) through it; /zen/go,
  paid models and metadata requests keep the regular client.
2026-10-19 08:33:12 +08:00
Jason Xu fdae1902a0 feat: add authenticated web management console 2026-08-16 04:29:43 +08:00