0.3.0 • Published 9 years ago

superagent-hosts v0.3.0

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

superagent-hosts

extra hosts file for nodejs superagent requests

Build Status

Example

./hosts

192.168.10.12 foobar.com

./app.js

var request = require('superagent');
var hosts = require('superagent-hosts');
var config = require('fs').readFileSync('./hosts').toString();
request
  .get('http://foobar.com/path/to')
  .use(hosts(config))
  .end(function (err, res) {
    // ...
  });

License

the MIT License