0.0.5 • Published 8 years ago

pico-proxy v0.0.5

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

pico-proxy NPM version

Tiny http proxy for interacting with cross-domain APIs without CORS

Install

$ npm install -g pico-proxy

Usage

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 */

CLI

$ 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"
0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago