rhocfsandbox.com

demo: advanced rate limiting

a rate limit rule on /api/ratelimit-me: 10 requests per 10 seconds per source ip, with a 10 second mitigation timeout. hit the button to fire 20 rapid requests. requests 11-20 come back as 429 from cloudflare's edge — the origin function never runs.

# hammer it (browser)

click "fire 20 requests" to start…

# hammer it (curl)

for i in $(seq 1 20); do
  curl -s -o /dev/null -w "req %2d → %{http_code}\n" $i "https://rhocfsandbox.com/api/ratelimit-me"
done

# what's the rule

rulesetzone → security → waf → rate limiting rules
rule nameSITE_ratelimit_hammer
characteristicsource ip
threshold10 requests / 10 seconds
mitigation timeout10 seconds
actionblock · custom html response (429)