Worker Rate Limiting API Not Triggering for IPv6
We noticed when using the Rate Limit api/binding for workers that the rate limit never seemed to trigger for IPv6 traffic. It only triggered for IPv4 traffic. This was tested using cf-connecting-ip and x-real-ip as the rate limiter key. Is there a different header or method we can use to reliably rate limit by IP? Not sure if our IPv4 settings for the site are causing the issues.
We are aware that shared IP's is a common issue with rate limiting per IP, for our use case this is not an issue.
2 Replies
Never? Did you try logging? One thing with IPv6 is you usually want to rate limit by the /64 (CF normal rate limiting does this too) because how many IPv6s you can get easily and each device having a different ip/changing every so often thanks to slaac, etc
this works fine for me:
Chaika, thanks, that's super helpful - I will test this out. Did not know about using the /64
I realized we are on enterprise and I believe we use the "Overwrite headers" version of psuedo IPv4 (https://developers.cloudflare.com/network/pseudo-ipv4/) so I am trying to narrow down if issue is due to ipv6 or due to that setting, or something else
Will probably try using CF-Connecting-IPv6 if provided and use the /64 of that