npm install substituteA proxy image server. This is a rewrite version of camo.


Install with npm:
```
$ npm install substitute -g
`
$ substitute -h
Usage: substitute [options]
Options:
-b, --bind
--host
--path
-c, --config
-r, --redirects
-s, --secret
-V, --version Display the version
-h, --help Display this help menu
`
Unlike camo, substitute supports only one URL Format:
``
http://example.org/
The is a 32 character hex encoded HMAC digest with a secret in md5 hash. And the should be an ecoded/escaped replaced '/' uri.
``
http://example.org/moc.dlrowsmuabe.aidem/d42a08bfa19e5b526b0d2d53eb3b106c/picture/Mincemeat/Pimp.jpg
You can get the browser client with component(1):
$ component install lepture/substitute
And generate new src with:
`js
var substitute = require('substitute');
substitute.server = 'https://example.com';
substitute.secret = 'a secret that match the server secret';
var newSrc = substitute.link('http://path/to/image');
// replace all image src
var newHtml = substitute.image(html);
`
Test it manally, start a server:
``
$ substitute
And then visit: this link.
Test it automatically with mocha:
``
$ make test
You can also test the client part with:
``
$ make test-client
`js
var substitute = require('substitute');
console.log(substitute.version);
substitute.defaults({
maxRedirects: 5
});
var server = substitute(secret, options);
server.listen(8000)
``