Merge pull request #18 from matiu/feature/keep-alive-optional
add option to RpcClient to enable keep-alive (false by default)
This commit is contained in:
commit
a6cb632f26
|
@ -16,6 +16,7 @@ function ClassSpec(b) {
|
||||||
this.pass = opts.pass || 'pass';
|
this.pass = opts.pass || 'pass';
|
||||||
this.protocol = (opts.protocol == 'http') ? http : https;
|
this.protocol = (opts.protocol == 'http') ? http : https;
|
||||||
this.batchedCalls = null;
|
this.batchedCalls = null;
|
||||||
|
this.disableAgent = opts.disableAgent || false;
|
||||||
}
|
}
|
||||||
|
|
||||||
RpcClient.prototype.batch = function(batchCallback, resultCallback) {
|
RpcClient.prototype.batch = function(batchCallback, resultCallback) {
|
||||||
|
@ -147,6 +148,7 @@ function ClassSpec(b) {
|
||||||
path: '/',
|
path: '/',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
port: self.port,
|
port: self.port,
|
||||||
|
agent: self.disableAgent ? false : undefined,
|
||||||
};
|
};
|
||||||
if(self.httpOptions) {
|
if(self.httpOptions) {
|
||||||
for(var k in self.httpOptions) {
|
for(var k in self.httpOptions) {
|
||||||
|
|
Loading…
Reference in New Issue