Skip to content

fix(proxy): probe the OpenCode origin instead of cloudflare.com - #153

Merged
jasonxu114514 merged 1 commit into
jasonxu114514:mainfrom
WengeLiu101:pr/probe-opencode-origin
Nov 5, 2026
Merged

jasonxu114514 merged 1 commit into
jasonxu114514:mainfrom
WengeLiu101:pr/probe-opencode-origin

Conversation

@WengeLiu101

Copy link
Copy Markdown
Contributor

Problem

The health probe exists to answer one question: can this exit serve traffic? It currently targets https://cloudflare.com/cdn-cgi/trace — an unrelated third-party host. Proxy providers routinely block or rate-limit Cloudflare on their egress, so an exit that serves OpenCode perfectly well can fail the probe, be disabled after disable_after_failures, and eventually be retired — while real anonymous traffic through that same exit still returns 200.

Evidence (from our deployment)

  • A 1400-exit pool: the rolling probe retired the whole pool, yet anonymous requests through the same exits were answering 200 with attempts=1 (first exit tried).
  • Providers also surface their own CONNECT errors through the probe (e.g. 429 Not Enough Bandwidth for quota exhaustion). Those say something about the provider's quota, not about whether the OpenCode origin is reachable — but the current probe cannot tell the difference.

Change

  1. Probe target → https://opencode.ai/. checkClaimedProxy already counts any HTTP response as success, so a 404 from the origin still proves the tunnel reaches it.
  2. Probe client → reuse proxy.bun when present, the same client free-model traffic uses. The probe then exercises the path it judges (Bun/uTLS fingerprint) instead of a plain Go TLS handshake.

Scope

  • No change to the healthy/dead semantics or to the retirement thresholds.
  • No config changes; keyed lanes' request path is untouched.
  • Happy to turn the target into a config key if you would rather keep it configurable.

Verification

  • go build ./... passes; gofmt clean.
  • Ran the change against a 1400-exit pool: exits the cloudflare probe had retired were served again by real traffic under the origin probe.

@jasonxu114514

Copy link
Copy Markdown
Owner

The purpose of Cloudflare CDN traces is to prove that the proxy can connect to the network normally,

@jasonxu114514
jasonxu114514 merged commit 079cd7b into jasonxu114514:main Nov 5, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants