Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
a proxy that does cors
JavaScript
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
README.md
cors-proxy.js
package.json

README.md

cors-proxy

A proxy that does CORS

npm install -g cors-proxy
cors-proxy

Use it with a function like

function proxy(url, headers, auth) {
    return 'http://localhost:3001/' +
        '?url=' + encodeURIComponent(url) +
        (headers ? ('&headers=' + encodeURIComponent(JSON.stringify(headers))) : '') +
        (auth ? ('&auth=' + encodeURIComponent(JSON.stringify(auth))) : '');
}

And you can make CORS requests to localhost:3001 from localhost on other ports.

Something went wrong with that request. Please try again.