Tiny http proxy for interacting with cross-domain APIs without CORS
$ npm install -g pico-proxy
var picoProxy = require('pico-proxy');
var proxy = picoProxy({ target: 'http://api.domain.com' }).listen(3000);
/* All requests to http://127.0.0.1:3000 will be proxied to http://api.domain.com */
$ pico-proxy --help
Usage
$ pico-proxy <target>
Options
--target hostname or ip to the target server, defaults to http://127.0.0.1
--port port to listen to for the proxy server, defaults to 8080
--protocol protocol used when creating the proxy server, defaults to http
--cors if the proxy server should handle CORS requests, defaults to true
--allow-headers overrides for Access-Control-Allow-Headers, defaluts to '*'
--allow-methods overrides for Access-Control-Allow-Methods, defaults to '*'
--allow-request overrides for Access-Control-Allow-request-Methods, defaults to '*'
Examples
$ pico-proxy --port 3333 --protocol http --target http://api.hostname.com
$ pico-proxy --target http://api.hostname.com --allow-headers "Content-type,X-Sessioncookie"