Add ability to pass proxy

This commit is contained in:
Andrew Stewart 2014-08-12 10:07:17 -07:00
parent df60282042
commit ffc27f9942
1 changed files with 6 additions and 2 deletions

View File

@ -31,8 +31,12 @@ var Driver = module.exports = function Driver(opts) {
Utils.subclass(Driver, Basestar); Utils.subclass(Driver, Basestar);
Driver.prototype.setupCommands = function(commands) { Driver.prototype.setupCommands = function(commands, proxy) {
this.proxyMethods(commands, this.connection, this); if (proxy == null) {
proxy = this.connection;
}
this.proxyMethods(commands, proxy, this);
for (var i = 0; i < commands.length; i++) { for (var i = 0; i < commands.length; i++) {
var command = commands[i]; var command = commands[i];