You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: address review feedback on Cloudflare routing PR
- TestGetContentCustom: pass the rule directly to getContent so it actually
exercises the custom-rule path; the RulesMock.GetFunc setup was dead code
after getContent stopped looking up rules
- CloudflareRetriever.MaxRetries: remove default substitution for the zero
value — 0 now means "no retries" as expected. Callers opt into retries by
setting MaxRetries explicitly; main.go uses the exported CFDefaultMaxRetries
constant (2)
- README: add cf-route-all to the config table and rewrite the Cloudflare
section to reflect the opt-in routing model + 429 retry behaviour
- rest.Server.Run: expand the WriteTimeout comment to explain why the 150s
ceiling is server-wide rather than per-route via http.TimeoutHandler
| cf-account-id| CF_ACCOUNT_ID | none | Cloudflare account ID for Browser Rendering API |
20
20
| cf-api-token | CF_API_TOKEN | none | Cloudflare API token with Browser Rendering Edit perm |
21
+
| cf-route-all | CF_ROUTE_ALL |`false`| route every request through Cloudflare Browser Rendering |
21
22
| dbg | DEBUG |`false`| debug mode |
22
23
23
24
### Cloudflare Browser Rendering (optional)
24
25
25
-
When both `--cf-account-id` and `--cf-api-token` are set, the service uses Cloudflare Browser Rendering API to fetch page content instead of direct HTTP. This renders JavaScript and handles bot-protection pages that return empty or "just a moment..." responses to standard HTTP requests.
26
+
Cloudflare Browser Rendering is useful for JavaScript-heavy pages and sites behind a "please enable JS" wall, but it's slower than direct HTTP and the free tier throttles at 1 request per 10 seconds. To keep the service cost-effective, Cloudflare routing is **opt-in**.
26
27
27
-
When these flags are not set, the service uses a standard HTTP client (default).
28
+
1. Set `--cf-account-id` and `--cf-api-token` to enable Cloudflare routing.
29
+
2. Either flip the `use_cloudflare` checkbox on individual rules (per-domain, recommended) or set `--cf-route-all=true` to route every request through Cloudflare.
30
+
31
+
When Cloudflare credentials are not set, the service uses a standard HTTP client for everything (default). On HTTP 429 (rate limit) the service automatically retries with exponential backoff and respects the `Retry-After` header.
0 commit comments