the other API service blocked ip from cloudflare (fetch issue)

I am writing a workers code that sends http requests to other API servers(third-party) and stores the responses in r2. I used "fetch()" to get api response but it returns 403 error via domain workers request.(~.~.workers.dev) But it works on via clicking test button in workers quick edit. It seem to blocking api request by some conditions at third party API. So I checked each "X-Forwarded-For"(workers ip) header. And the result is below. clicking test button in quick edit = 34.29.117.83 (owned by google) request via domain(~.~.workers.dev) = 2a06:98c0:3600::103 (owned by cloudflare) I think the third-party API server blocked ip owned by cloudflare to block WARP vpn(cloudflare service). Therefore The third-party API server never allow ip owned by cloudflare. So is there way to change workers ip to ip that not owned by cloudflare? (using google owned ip like test request) Or when execute fetch() is there a way of deceiving third party API server? I tried set X-Forwarded-For header but it didn't overwrote. thank you for reading this question😁
4 Replies
kian
kian3y ago
is there a way of deceiving third party API server?
Nope - your only option really is running requests through an external proxy server.
Lloyd
LloydOP3y ago
Is that really the only way to solve this issue? The response data is big and frequent. So if I use external proxy server, it will be slow or pay a lot. crying 😢 thank you for comment..
Acе
Acе3y ago
The other way is to get them to unblock Cloudflare lol
rob
rob2y ago
can't use HTTP proxies wotn fetch on workers?

Did you find this page helpful?