Socket
Socket
Sign inDemoInstall

web3-providers-http

Package Overview
Dependencies
Maintainers
1
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.0.0-beta.27 to 1.0.0-beta.28

4

package.json
{
"name": "web3-providers-http",
"namespace": "ethereum",
"version": "1.0.0-beta.27",
"version": "1.0.0-beta.28",
"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.27",
"web3-core-helpers": "1.0.0-beta.28",
"xhr2": "0.1.4"
}
}

@@ -31,9 +31,24 @@ /*

*/
var HttpProvider = function HttpProvider(host, timeout) {
var HttpProvider = function HttpProvider(host, timeout, headers) {
this.host = host || 'http://localhost:8545';
this.timeout = timeout || 0;
this.connected = false;
this.headers = headers;
};
HttpProvider.prototype._prepareRequest = function(){
var request = new XHR2();
request.open('POST', this.host, true);
request.setRequestHeader('Content-Type','application/json');
if(this.headers) {
this.headers.forEach(function(header) {
request.setRequestHeader(header.name, header.value);
});
}
return request;
};
/**

@@ -48,6 +63,4 @@ * Should be used to make async request

var _this = this;
var request = new XHR2();
var request = this._prepareRequest();
request.open('POST', this.host, true);
request.setRequestHeader('Content-Type','application/json');

@@ -54,0 +67,0 @@ request.onreadystatechange = function() {

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