Ensuring Consistent IPv4 Address for Outgoing Requests from Cloudflare Worker

Hello everyone, I'm using Cloudflare Workers to make outgoing fetch requests to an external server. For various reasons, I need these requests to consistently come from the same IPv4 address. During my tests, I've observed that the source IPv4 address changes intermittently. I understand this might be due to Cloudflare's distributed nature and how they handle outgoing traffic. 1. Is there a way to ensure that my Cloudflare Worker uses a consistent IPv4 address for its outgoing requests? 2. Are there any recommended practices or configurations within Cloudflare to achieve this, or is it a limitation of the platform? Any insights or suggestions would be greatly appreciated. Thank you!
6 Replies
Hello, I’m Allie!
Afaik, no. Workers will use any IP from the IP pool, and you can't force it to use one.
Storhanen
Storhanen9mo ago
Thank you for a quick response! Are there known/recommended workarounds or strategies that others have employed for scenarios where a consistent IP is crucial?
Hello, I’m Allie!
A proxy, maybe? Is this because your origin needs it, or an external service?
Storhanen
Storhanen9mo ago
I've read that Cloudflare Workers don't support making outbound requests through traditional proxies. Is this accurate? It is the external service that needs it
Hello, I’m Allie!
Yes, you would have to use some kind of HTTP-based proxy(like the one Hoppscotch uses)
Storhanen
Storhanen9mo ago
Thanks for the info and your time. I'll give that a try. Much appreciated!