pskupinski / node-btc-e

A deprecated unofficial node.js client for the btc-e api.
ISC License
39 stars 20 forks source link

Possiblity to specify a different http agent #2

Closed tommuhm closed 10 years ago

tommuhm commented 11 years ago

First off, i wanted to thank you for this project. The code looks really good and is nice to read :)

I just have a small feature request: I would like to specify my own http agent e.g.: https://github.com/TBEDP/agentkeepalive.

I tested the agent above with another btce module and it nearly doubled my request speed.

This feature would also add the possibility to use proxies with a proxy-agent like: https://github.com/koichik/node-tunnel

Thanks & Best Regards Tom

pskupinski commented 10 years ago

I am pleased to report that this has finally been resolved with the release of version 0.0.16.

The third parameter to the constructor can now be a hash of options in addition to a nonce generation function.

The supported options are:

An example of this new functionality:

var BTCE = require('btc-e');
var HttpsAgent = require('agentkeepalive').HttpsAgent;
var btce = new BTCE('apiKey', 'secret', {
  agent: new HttpsAgent()
});

btce.getInfo(function (err, data) {
  console.log(err, data);
});