0.2.6 • Published 10 years ago

adhoc-cors-proxy v0.2.6

Weekly downloads
6
License
MIT
Repository
github
Last release
10 years ago

Ad-hoc cors proxy

Dependency Status

Simple reliable node-based cors proxy.

$ corsproxy www.target.com -p 8080
proxy to http://www.target.com started on port 8080

Why simple reliable? Because it just assembles two well tested and actively maintained middlewares: http-proxy and cors. It's a package you could have written yourself, but this one's ready to use with complete usage instructions (thanks to docopt).

Installation

local testing

$ npm install adhoc-cors-proxy

global install

$ npm install -g adhoc-cors-proxy

Usage

with local install

node bin <target> [--port=<port>] [--origin=<origin>] [--credentials]
node bin -h | --help | --version

with global install

corsproxy <target> [--port=<port>] [--origin=<origin>] [--credentials]
corsproxy -h | --help | --version

### Options

-p <port>, --port=<port>        Port number. [default: 9292]
--host=<host>                   Host
-o <origin>, --origin=<origin>  Restrict origin domain
-c, --credentials               access-control-allow-credentials=true

Alternatively, the proxy can be configured entirely using environment variables. Check the sources for a better understanding of configuration priority.

## Production

I recommend using Heroku's free tier or pm2 on a virtual-machine cloud-service.

Development

You can hack into this package by installing grunt

$ npm install -g grunt-cli

Starting the server and specifying the target has a slightly different syntax:

$ grunt --target=http://www.target.com -p 8080

Jshint will check your code and the proxy will restart everytime the sources are modified.

License

MIT

0.2.6

10 years ago

0.2.5

10 years ago

0.2.4

10 years ago

0.2.3

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.0

10 years ago