Socket
Socket
Sign inDemoInstall

web3-providers-http

Package Overview
Dependencies
Maintainers
1
Versions
420
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.0.0-beta.34 to 1.0.0-beta.35

6

package.json
{
"name": "web3-providers-http",
"namespace": "ethereum",
"version": "1.0.0-beta.34",
"version": "1.0.0-beta.35",
"description": "Module to handle web3 RPC connections over HTTP.",

@@ -10,5 +10,5 @@ "repository": "https://github.com/ethereum/web3.js/tree/master/packages/web3-providers-http",

"dependencies": {
"web3-core-helpers": "1.0.0-beta.34",
"xhr2": "0.1.4"
"web3-core-helpers": "1.0.0-beta.35",
"xhr2-cookies": "1.1.0"
}
}

@@ -34,3 +34,7 @@ # web3-providers-http

var http = new Web3HttpProvider('http://localhost:8545');
var options = {
timeout: 20000, // milliseconds,
headers: [{name: 'Access-Control-Allow-Origin', value: '*'},{...}]
};
var http = new Web3HttpProvider('http://localhost:8545', options);
```

@@ -37,0 +41,0 @@

@@ -26,3 +26,3 @@ /*

var errors = require('web3-core-helpers').errors;
var XHR2 = require('xhr2'); // jshint ignore: line
var XHR2 = require('xhr2-cookies').XMLHttpRequest // jshint ignore: line

@@ -32,7 +32,8 @@ /**

*/
var HttpProvider = function HttpProvider(host, timeout, headers) {
var HttpProvider = function HttpProvider(host, options) {
options = options || {};
this.host = host || 'http://localhost:8545';
this.timeout = timeout || 0;
this.timeout = options.timeout || 0;
this.headers = options.headers;
this.connected = false;
this.headers = headers;
};

@@ -45,2 +46,4 @@

request.setRequestHeader('Content-Type','application/json');
request.timeout = this.timeout && this.timeout !== 1 ? this.timeout : 0;
request.withCredentials = true;

@@ -67,3 +70,2 @@ if(this.headers) {

request.onreadystatechange = function() {

@@ -70,0 +72,0 @@ if (request.readyState === 4 && request.timeout !== 1) {

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