Skip to content

tmcw-up-for-adoption/cors-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Replaced by gkucmierz/cors-proxy in new versions: this npm package is now maintained by gkucmierz and has a different interface in new versions.

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.

About

a proxy that does cors

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published