This project is written in Cloudfalre Workers, and can be easily deployed with Wrangler CLI.
wrangler deploy
const YOUR_CLOUDFLAIRE_PROXY_SERVER = "https://your-cloudflare.workers.dev";
const YOUR_TARGET = "https://what-ever-api.org/?a=1&b=2";
const response = await fetch("${YOUR_CLOUDFLAIRE_PROXY_SERVER}?${YOUR_TARGET}", {
mode: 'cors'
});
const body = await response.arrayBuffer();
Note:
All received headers are also returned in "cors-received-headers" header.
The proxy accepts only fetch and XmlHttpRequest.
To create your own is very easy, you just need to set up a cloudflare account and upload the worker code.