Skip to content

Reach the website through cast.weenas.com where Cloudflare is blocked - #185

Merged
easonxiang merged 1 commit into
mainfrom
cast-relay
Oct 4, 2026
Merged

easonxiang merged 1 commit into
mainfrom
cast-relay

Conversation

@easonxiang

Copy link
Copy Markdown
Contributor

In many mainland-China networks castbay.weenas.com (Cloudflare) is unreachable. On those networks the update check fell back to GitHub, which had no release notes, and problem reports and statistics failed outright.

  • Relay: cast.weenas.com runs on the developer's VPS (Apache, ZeroSSL cert trusted by old Android). It forwards only GET /latest.json and POST /api/reports|stats|stats/delete to the website and keeps no access log. It sends the device's address in X-CastBay-Client-IP.
  • Worker: trusts that header only from RELAY_IPS (45.195.196.12), and only for its rate limits.
  • App: util/Servers.kt tries the website, then the relay, starting with whichever answered last. An HTTP answer is not retried elsewhere. Update check order: website → relay → GitHub.
  • Privacy policy (en/zh): new "The relay" section.

Tested on a Google TV whose network can't reach Cloudflare:

  • the update check timed out on the website, then succeeded through the relay;
  • a problem report was uploaded through the relay (CB-K481Z8).

🤖 Generated with Claude Code

In many networks in mainland China castbay.weenas.com (Cloudflare)
can't be reached, so the update check fell back to GitHub (without
release notes) and problem reports and statistics couldn't be sent at
all. A Google TV on such a network timed out connecting to it while
reaching GitHub and the developer's server fine.

cast.weenas.com is a relay on that server (Apache, its own ZeroSSL
certificate, which old Android trusts): it passes only GET
/latest.json and POST /api/reports, /api/stats and /api/stats/delete
on to the website, keeps no access log, and names the device's
address in X-CastBay-Client-IP, which the Worker believes only from
the relay's address (RELAY_IPS) and uses only for its rate limits.

The app's requests (util/Servers.kt) try the website, then the relay,
starting with whichever answered last; an HTTP answer isn't retried
elsewhere. -Pcastbay.reportsUrl becomes -Pcastbay.serverUrl, the base
address (no relay then). The privacy policy describes the relay.

Tested on the Google TV (website unreachable): the update check and a
problem report (CB-K481Z8) both went through the relay.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@easonxiang
easonxiang merged commit 0c5a6eb into main Oct 4, 2026
6 checks passed
@easonxiang
easonxiang deleted the cast-relay branch October 4, 2026 02:40
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.

1 participant