Replaced by gkucmierz/cors-proxy in new versions: this npm package is now maintained by gkucmierz and has a different interface in new versions.
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.