Skip to content

hpb-htw/jpl-cors-proxy

 
 

Repository files navigation

jpl-cors-proxy

Source:

jpl-cors-proxy

Deployment

This project is written in Cloudfalre Workers, and can be easily deployed with Wrangler CLI.

wrangler deploy

Usage Example

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.

About

sunray cors

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%