Proxy middleware for koa
Install
$ npm install koa-proxy -S
Usage
When you request http://localhost:3000/index.js, it will fetch http://alicdn.com/index.js and return.
var koa = ;var proxy = ;var app = ;app;app;
You can proxy a specified url.
app;
You can specify a key/value object that can map your request's path to the other.
app;
You can specify a function that can map your request's path to the desired destination.
app;
You can specify match criteria to restrict proxy calls to a given path.
app;
Or you can use match to exclude a specific path.
app;
Proxy won't send cookie to real server, you can set jar = true
to send it.
app;
Proxy won't send 'foo' and 'bar' headers to real server, or recieve 'jar-jar' from real server.
app;
You can also add new headers to your response or override existing ones
app;
LICENSE
Copyright (c) 2014 popomore. Licensed under the MIT license.