Skip to content

Commit

Permalink
Merge branch '1.0' into fix-mishandledBytes
Browse files Browse the repository at this point in the history
  • Loading branch information
nivida authored Dec 8, 2018
2 parents 433d811 + 613a222 commit 617fd0b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/web3-providers-http/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,16 @@ var https = require('https');
*/
var HttpProvider = function HttpProvider(host, options) {
options = options || {};

var keepAlive =
(options.keepAlive === true || options.keepAlive !== false) ?
true :
false;
this.host = host || 'http://localhost:8545';
if (this.host.substring(0,5) === "https"){
this.httpsAgent = new https.Agent({ keepAlive: true });
if (this.host.substring(0,5) === "https") {
this.httpsAgent = new https.Agent({ keepAlive: keepAlive });
}else{
this.httpAgent = new http.Agent({ keepAlive: true });
this.httpAgent = new http.Agent({ keepAlive: keepAlive });
}
this.timeout = options.timeout || 0;
this.headers = options.headers;
Expand Down

0 comments on commit 617fd0b

Please sign in to comment.