A caching HTTP forward proxy.
Features:
headerOrder in index.js)User-Agent instead of user-agent)X-Cache-Preferred header is
present (this header is never sent to the target)PROXY_AUTH is set, the proxy will reject all
incoming requests that doesn't have a header X-Proxy-Auth with the
same valueMONGO_URI to specify
connection string (defaults to: localhost/http-proxy-cache)npm install http-proxy-cache -g
To start the proxy, simply run:
http-proxy-cache
This is an example app that uses the request module to perform a HTTP request via the proxy to httpbin which will echo the HTTP request back as the reponse body:
var request = require('request')
request({
uri: 'http://httpbin.org/get',
proxy: 'http://<your-proxy-domain-here>'
}, function (err, res, body) {
if (err) throw err
console.log(body)
})
Set the environment variable DEBUG=proxy to enable debug mode.
MIT