Skip to content

CORS Proxy Explained (corsproxy.io, AllOrigins)

A woman working on a laptop with a web page open in the browser
Photo: Christina Morillo / Pexels. A CORS error appears in the browser, but the fix usually sits on the server side of the request.

A CORS proxy is a server that fetches a web resource on your behalf and returns it with the CORS headers your browser needs, so a frontend app can read an API response that a direct browser request cannot. The two names you will meet most often are corsproxy.io, a hosted service with a free tier, and AllOrigins, a free open-source proxy at api.allorigins.win. This guide explains how both work, shows working code, compares the free options, and covers when a public CORS proxy is the wrong tool.

A woman working on a laptop with a web page open in the browser
Photo: Christina Morillo / Pexels. A CORS error appears in the browser, but the fix usually sits on the server side of the request.

What Is CORS, and Why Does the Browser Block Your Request?

CORS stands for Cross-Origin Resource Sharing. It is the mechanism browsers use to decide whether JavaScript on one origin may read a response from another origin. An origin is the combination of protocol, domain, and port, so http://localhost:3000 and https://api.example.com are different origins even though both belong to your project.

The rule behind CORS is the same-origin policy: by default, a web page can only read responses from the origin that served it. When your frontend JavaScript calls an API on another origin, the browser sends the request, but it will not let your code read the response unless the API answers with an Access-Control-Allow-Origin header that names your origin or uses the * wildcard. If that header is missing, the browser blocks the response and reports a CORS error in the console. The request itself reached the API and the API may even have answered with a 200 status, but your JavaScript never sees the body.

This is a browser rule, not a server rule. The same request works from curl, Postman, or a Node script, because those tools do not enforce the same-origin policy. That difference is the fastest way to confirm a problem is CORS and not a broken API: if curl returns the data and the browser does not, the API is fine and the browser is enforcing CORS.

Some requests need an extra step called a preflight. When a request uses a method other than GET, HEAD, or POST, sends a custom header, or posts a content type outside the small safelist, the browser first sends an OPTIONS request to ask the API whether the real request is allowed. The API must answer with Access-Control-Allow-Methods and Access-Control-Allow-Headers before the browser sends the real request.

What Is a CORS Proxy?

A CORS proxy is a server that makes the cross-origin request for you. Your browser calls the proxy, which is an origin the browser is allowed to read, and the proxy calls the target API server-to-server, where no browser policy applies. The proxy then returns the API response with Access-Control-Allow-Origin headers added, so your JavaScript can read it.

The request flow changes from two parties to three. Without a proxy, the browser calls the API directly and the browser blocks the response. With a proxy, the browser calls the proxy, the proxy calls the API, and the proxy returns the response with permissive CORS headers.

A developer looking at code on a laptop screen
Photo via Pexels. The proxy adds the missing headers, so the browser lets your JavaScript read a response it would otherwise block.

The API sees the proxy’s IP address, not the visitor’s, and any cookies or credentials tied to the API’s origin are not sent, because the request to the API comes from the proxy server, not from the visitor’s browser.

A CORS proxy does not fix authentication, rate limits, or bot protection. It only solves the missing-header problem. If the API needs a login, a key, or a CAPTCHA, the proxy cannot supply it, and routing around an access control with a proxy is not a legitimate use. A CORS proxy is a development shortcut and a tool for reading public data, not a way to reach private or protected resources.

corsproxy.io: How It Works

corsproxy.io is a hosted CORS proxy that requires a free account and an API key. The target URL goes in the url parameter, percent-encoded, alongside your key:

const target = encodeURIComponent('https://api.example.com/data');
const response = await fetch(
  `https://corsproxy.io/?key=YOUR_API_KEY&url=${target}`
);

The free tier allows up to 10,000 requests and 1 GB of bandwidth per month, as stated on the corsproxy.io homepage and confirmed in a November 2026 comparison of free CORS proxies. The corsproxy.io free proxy tier is a public proxy service: it is designed not to forward cookies or Authorization headers to target servers, which limits what a leaked key can do, but also means it cannot call APIs that need your login.

The corsproxy.io URL proxy API goes beyond a plain fetch. The same URL format supports extra parameters: ttl caches a response at the edge for a number of seconds, image, imageWidth, and imageHeight resize and crop a remote image, and input=rss with output=json converts a feed to JSON. Some extras are production-plan features, so check the current pricing page before building on them.

Because corsproxy.io needs a key, it can enforce per-account quotas, which is what keeps one heavy user from slowing the service for everyone else. The trade-off is that your key is visible in client-side JavaScript, so anyone who reads your page source can copy it.

AllOrigins: The Free, Open-Source Option

AllOrigins is a free and open-source CORS proxy, and its public instance lives at api.allorigins.win. It needs no account and no key, which makes it the easiest CORS proxy to start with and the hardest to depend on. The project is MIT licensed, and its code is on GitHub under gnuns/allOrigins, where it has been maintained since 2016.

AllOrigins has two main endpoints. /raw returns the target content exactly as the upstream sent it, and /get wraps the content in a JSON object with the body in the contents property:

fetch(`https://api.allorigins.win/raw?url=${encodeURIComponent('https://example.com')}`)
fetch(`https://api.allorigins.win/get?url=${encodeURIComponent('https://example.com')}`)
  .then(response => response.json())
  .then(data => console.log(data.contents));

The /get endpoint also supports a callback parameter for JSONP responses and a charset parameter to set the response character encoding, both documented in the project README. The AllOrigins raw URL proxy is the better choice for most new code, because it returns the content directly and preserves the upstream status code. With /get, an upstream 404 arrives as a 200 response with the error hidden inside the JSON, which makes error handling harder.

The public AllOrigins instance is a shared, keyless service, so its reliability varies. A November 2026 check found each endpoint succeeding once and failing once in repeated requests, with failures showing as 520 or 522 errors from the CDN in front of the server, which the browser then reports as a CORS error because the error page carries no CORS headers.

A developer working on a laptop at a desk
Photo via Pexels. AllOrigins is free and needs no key, but a shared keyless service has no way to stop one heavy user slowing it down for everyone.

How the Target URL Is Passed: Query, Path, and Base64

Different CORS proxies accept the target URL in different places, and mixing them up is a common source of errors. The query-parameter form puts the target in a url parameter, as corsproxy.io and AllOrigins do. The path form puts the target URL after the proxy host, as in https://proxy.example/https://api.example.com/data. Some public proxies accept the target URL base64-encoded, either in the path or in a parameter, which avoids problems with special characters in the target URL.

A free CORS proxy base64 URL endpoint takes the target URL, encodes it with base64, and places the encoded string in the request path or parameter, so the proxy can decode it and fetch the original address. A public CORS proxy base64 URL endpoint works the same way for query strings. The exact form depends on the service, so read its documentation rather than guessing: a base64-encoded URL sent to a proxy that expects a plain URL will fail, and a plain URL sent to one that expects base64 will fail too.

Whatever the form, always percent-encode or base64-encode the target URL before adding it to the request. An unencoded target with its own query string will break the proxy URL, because the proxy will read the target’s ? and & characters as its own parameters.

Close-up of code on a laptop screen
Photo via Pexels. Encode the target URL before adding it to a proxy request, or its query string will break the proxy URL.

Free CORS Proxies Compared

The free CORS proxy landscape changes often, and a service that works today may be gone or rate-limited next month. The table below uses figures from a November 2026 comparison and the services’ own pages, and every figure should be re-checked at publish time.

ServiceHow it worksFree tierKey neededBest for
corsproxy.ioHosted proxy, target in url parameter10,000 requests and 1 GB per monthYes, free accountKeyed GETs and POSTs against public APIs
AllOrigins (api.allorigins.win)Hosted community proxy, /raw and /getNo published limitsNoQuick one-off fetches and demos
CodeTabs (api.codetabs.com/v1/proxy)Hosted proxy, target as query parameterNo published limitsNoSimple GET requests without a key
corsproxy.devHosted proxy with API key, plus open-source Go proxy500 requests and 250 MB per dayYesPOST requests on a free plan, or self-hosting
cors.sh (proxy.cors.sh)Hosted proxy with API keyFree tier with limitsYesKeyed requests with a dashboard
CORS AnywhereSelf-hosted Node.js proxyYour own infrastructureNo, self-hostedFull control when you can run a server

Two patterns stand out. Keyless services such as AllOrigins and CodeTabs are the easiest to try and the least reliable under load, because they cannot limit abusive users. Keyed services such as corsproxy.io and corsproxy.dev are more stable, because quotas keep one user from taking the service down, but your key is visible in client-side code. For anything beyond a prototype, self-hosting or a small backend route of your own is more reliable than any shared free proxy.

A note on older names: several tutorials still mention ThingProxy and the public CORS Anywhere demo. The CORS Anywhere public demo is rate limited and requires opting in, and it is designed as a demo of the self-hosted package, not as a service. Treat any older proxy named in a tutorial as unverified until you confirm it still answers.

Using a CORS Proxy in Code

A minimal fetch through corsproxy.io looks like the example above: build the proxy URL with your key and the encoded target, then call fetch on it. The same shape works for AllOrigins with the /raw endpoint and no key. For a POST request, pass the method and body to fetch as usual, and confirm the proxy supports POST: corsproxy.io and corsproxy.dev both support POST on their free plans, while some keyless proxies only support GET.

const target = encodeURIComponent('https://api.example.com/items');
const res = await fetch(`https://api.allorigins.win/raw?url=${target}`);
if (!res.ok) throw new Error(`Upstream returned ${res.status}`);
const data = await res.json();

Always check res.ok before reading the body. With a proxy in the middle, a failed upstream request can arrive as a proxy error page, a JSON wrapper, or a status code that does not match the upstream one, depending on the service.

Two developers working together on code
Photo via Pexels. Check the response status before reading the body, because a proxy can return an error page with a 200 status.

Logging the status and the first lines of the body during development saves a long debugging session later.

When the target API is your own, or one you can change, the better fix is to configure CORS on the API itself: return Access-Control-Allow-Origin with your exact origin, not a wildcard, and allow the methods and headers your frontend sends. For development only, a local dev-server proxy is cleaner than a public CORS proxy: Vite, Create React App, and most frameworks let you route /api calls to the backend during development, so the browser never makes a cross-origin request at all. See our guides to proxy settings for npm, pip and Git and how to create your own proxy server.

CORS Proxy Security: What Can Go Wrong

A public CORS proxy sees every URL you send through it and every response that comes back. Never send API keys, access tokens, password-reset links, customer data, session identifiers, or private documents through one. The proxy operator can log the traffic, and a key sent through a proxy is a key the operator now holds. The same warning applies to the target URL itself: a URL that contains a token in its query string exposes that token to the proxy.

CORS proxies also create a risk for the people who run them. An open proxy that forwards any URL can be used to reach internal addresses, which is why a self-hosted proxy must block private and loopback addresses. The Go corsproxy project blocks cloud metadata addresses such as 169.254.169.254 by default, and it logs a warning for every protection left off. If you self-host any CORS proxy, restrict it to the origins and upstream hosts your app needs, add rate limits, and never expose an open relay to the public internet.

Debugging Proxies and Alternatives

When a request fails through a CORS proxy, the error message rarely says what went wrong. Check the browser console first: a CORS error means the proxy response lacked the header, which often means the proxy itself errored and returned an error page. Check the network tab next: the status code and the response body usually show whether the proxy, the upstream, or the browser is at fault. A 520 or 522 points at the proxy’s upstream connection. A 429 points at a rate limit. A 200 with an error page inside means the proxy returned something other than the upstream response.

Debugging proxies give you a closer look at what your app actually sends. Charles Proxy intercepts and inspects HTTP traffic from your machine, and our Charles Proxy guide explains how to set it up. Burp Suite is the standard tool for inspecting and modifying web requests, covered in our Burp Suite proxy setup guide. Fiddler and mitmproxy do similar work from the command line and the desktop, covered in our guide to Fiddler and mitmproxy. For image and API proxying beyond CORS, including image resizing proxies such as wsrv.nl, see our guide to image and API proxies.

Self-Hosting a CORS Proxy

Self-hosting removes the reliability problem of shared free proxies and the privacy problem of sending your traffic through a stranger’s server. Three options cover most needs. AllOrigins is the simplest to self-host: clone the repository, install dependencies, and start it, and it listens on port 1458 with the same /get and /raw endpoints as the public instance. CORS Anywhere is the classic Node.js option, and it is the package the whole genre grew from. A newer Go option is a single binary with no dependencies and a small Docker image, which listens on port 8080 and takes the target URL in a url parameter.

Whichever you choose, lock it down before it touches the public internet. Allow only your own site’s origin, allow only the upstream hosts your app calls, set a per-client rate limit and a daily request limit, and block private, loopback, and cloud metadata addresses. Our guide to proxy server software compares self-hosted proxy software, including CORS proxies and general-purpose servers, so you can pick the one that fits your stack.

Browser Extensions, Smart DNS, and Corporate Networks

A CORS proxy is not the only proxy a developer meets. Browser extensions such as FoxyProxy and SwitchyOmega manage proxy profiles inside Chrome and Firefox, switching proxies by site, and our guide to FoxyProxy and SwitchyOmega extensions covers their setup, including the Manifest V3 change that ended SwitchyOmega on Chrome. Smart DNS is a different tool: it reroutes only DNS lookups for chosen services rather than proxying traffic, and our guide to Smart DNS and DNS proxy explains when that is enough and when it is not.

Corporate networks add another layer. A company proxy can return errors such as 407 for authentication, 502 for a bad gateway, or a connection timeout, and the fix depends on the code. Our guide to corporate proxy errors and fixes lists the common codes with the fix for each one. For the broader developer setup, including environment variables and per-tool configuration, see our proxies for developers guide.

A person coding on a laptop with a second monitor
Photo via Pexels. A self-hosted CORS proxy is a small server you control, and it removes the reliability problem of shared free proxies.

When Not to Use a CORS Proxy

A public CORS proxy is the right tool for a prototype, a demo, or a quick fetch of public data from a third-party API that sends no CORS headers. It is the wrong tool for production traffic, for anything that carries credentials, and for any app where uptime matters. In production, the request should go through your own backend, which calls the API server-to-server and returns the data to your frontend from your own origin. That design has no CORS problem at all, because the browser only talks to your backend, and it keeps keys and tokens on the server where they belong.

Frequently Asked Questions

What is a CORS proxy?

A CORS proxy is a server that fetches a resource on your behalf and returns it with the CORS headers your browser needs, so frontend JavaScript can read an API response that a direct browser request cannot.

How does corsproxy.io work?

Your browser calls corsproxy.io with your API key and the percent-encoded target URL in a url parameter. The service fetches the target server-side, adds the CORS headers, and returns the response. The free tier allows 10,000 requests and 1 GB of bandwidth per month.

How do I use AllOrigins?

Call https://api.allorigins.win/raw?url= followed by the encoded target URL for the raw content, or /get?url= for a JSON wrapper with the content in the contents property. No account or key is needed.

What is the difference between AllOrigins /raw and /get?

/raw returns the upstream content exactly as sent, with the upstream status code. /get wraps the content in JSON, which hides the upstream status code, so an upstream 404 arrives as a 200 with the error inside the JSON.

Is a free CORS proxy safe?

Only for public data with no credentials. The proxy operator sees every URL and response you send through it, so never send API keys, tokens, or private data through a public CORS proxy.

Why does AllOrigins sometimes return a 520 or 522 error?

Those errors come from the CDN in front of the public AllOrigins server when the origin does not answer in time. The browser reports them as CORS errors because the error page has no CORS headers. Self-hosting AllOrigins or switching to a keyed proxy usually fixes it.

Can a CORS proxy handle POST requests?

It depends on the service. corsproxy.io and corsproxy.dev support POST on their free plans. Some keyless proxies only support GET, so check the service documentation before relying on POST.

What is the best alternative to a public CORS proxy?

Configure CORS on the API itself, route the call through your own backend, or use a dev-server proxy such as the one built into Vite. For production, your own backend is the reliable answer.

Sources

9

Every factual claim on this page was verified against a named source above. Free-tier limits and service behaviour were checked on 23 November 2026 and may change; check the provider page for current terms.

Marcus Doyle

Written by

Marcus Doyle Proxy Writer

Marcus's byline covers proxy types and proxy provider comparisons. Comparisons use each provider's documentation, pricing pages and published network details, all linked in the article. Figures quoted from a provider are labelled as the provider's own numbers.

How our articles are researched, reviewed and updated