Socket
Socket
Sign inDemoInstall

web3-providers-http

Package Overview
Dependencies
Maintainers
2
Versions
428
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

web3-providers-http - npm Package Compare versions

Comparing version 1.2.4 to 1.2.5-rc.0

6

package.json
{
"name": "web3-providers-http",
"version": "1.2.4",
"version": "1.2.5-rc.0",
"description": "Module to handle web3 RPC connections over HTTP.",

@@ -16,3 +16,3 @@ "repository": "https://github.com/ethereum/web3.js/tree/1.x/packages/web3-providers-http",

"dependencies": {
"web3-core-helpers": "1.2.4",
"web3-core-helpers": "1.2.5-rc.0",
"xhr2-cookies": "1.1.0"

@@ -24,3 +24,3 @@ },

},
"gitHead": "341015ab24efc3ea1e5d8afd07e8c92a7c738536"
"gitHead": "e919f81ccf7fee23a2d9075fa141bec0ff4a087a"
}

@@ -31,9 +31,14 @@ # web3-providers-http

// in node.js
var http = require('http');
var Web3HttpProvider = require('web3-providers-http');
var options = {
keepAlive: true,
timeout: 20000, // milliseconds,
headers: [{name: 'Access-Control-Allow-Origin', value: '*'},{...}]
headers: [{name: 'Access-Control-Allow-Origin', value: '*'},{...}],
withCredentials: false,
agent: {http: http.Agent(...), baseUrl: ''}
};
var http = new Web3HttpProvider('http://localhost:8545', options);
var provider = new Web3HttpProvider('http://localhost:8545', options);
```

@@ -40,0 +45,0 @@

@@ -37,14 +37,17 @@ /*

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: keepAlive });
} else {
this.httpAgent = new http.Agent({ keepAlive: keepAlive });
}
this.withCredentials = options.withCredentials || false;
this.timeout = options.timeout || 0;
this.headers = options.headers;
this.agent = options.agent;
this.connected = false;
var keepAlive = (options.keepAlive === true || options.keepAlive !== false) ? true : false;
this.host = host || 'http://localhost:8545';
if (!this.agent) {
if (this.host.substring(0,5) === "https") {
this.httpsAgent = new https.Agent({ keepAlive: keepAlive });
} else {
this.httpAgent = new http.Agent({ keepAlive: keepAlive });
}
}
};

@@ -60,6 +63,11 @@

request = new XHR2();
request.nodejsSet({
httpsAgent:this.httpsAgent,
httpAgent:this.httpAgent
});
var agents = {httpsAgent: this.httpsAgent, httpAgent: this.httpAgent, baseUrl: this.baseUrl};
if (this.agent) {
agents.httpsAgent = this.agent.https;
agents.httpAgent = this.agent.http;
agents.baseUrl = this.agent.baseUrl;
}
request.nodejsSet(agents);
}

@@ -66,0 +74,0 @@

@@ -23,2 +23,4 @@ /*

import * as http from 'http';
import * as https from 'https';
import { HttpProvider } from 'web3-providers';

@@ -35,3 +37,8 @@ import { JsonRpcResponse } from 'web3-core-helpers';

],
withCredentials: false
withCredentials: false,
agent: {
baseUrl: 'base',
http: new http.Agent({}),
https: new https.Agent({})
}
});

@@ -38,0 +45,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc