A simple CORS proxy built with Hono for Cloudflare Workers that allows you to access any web resource from your frontend application without CORS restrictions.
This proxy acts as an intermediary between your web app and any external API or resource, solving the CORS errors that would normally block direct requests from the browser.
- β CORS Error: "Access to fetch at 'https://api.example.com' from origin 'https://myapp.com' has been blocked by CORS policy"
- β APIs without CORS: Access to APIs that don't include CORS headers
- β Blocked resources: Images, videos or files from external domains
- πΌοΈ Images: JPG, PNG, WebP, GIF, SVG
- πΉ Videos: MP4, WebM, AVI
- π΅ Audio: MP3, WAV, OGG
- π Documents: PDF, ZIP, binary files
- π APIs: JSON, XML, HTML, CSS, JS
- π± Any web content
https://your-worker.your-subdomain.workers.dev/
https://your-worker.your-subdomain.workers.dev/?url=TARGET_URL
Access an image:
<img src="https://your-worker.workers.dev/?url=https://example.com/image.jpg" />Make an API request:
fetch("https://your-worker.workers.dev/?url=https://api.example.com/data.json")
.then((response) => response.json())
.then((data) => console.log(data));With URLs that have parameters:
const targetUrl = "https://api.example.com/search?q=hello&limit=10";
const proxyUrl = `https://your-worker.workers.dev/?url=${encodeURIComponent(
targetUrl
)}`;npm install -g wrangler
wrangler login
wrangler deploy- π Fast: Built with Hono, optimized for edge computing
- π Global: Deployed on Cloudflare's global network
- π Secure: URL validation and error handling
- π¦ Lightweight: No unnecessary dependencies
- π― Versatile: Automatically handles any content type
- Only supports GET requests
- URLs must start with
http://orhttps:// - Subject to Cloudflare Workers limits