Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

httpheaderprovider

Package Overview
Dependencies
Maintainers
0
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

httpheaderprovider

Replacement for HttpProvider from web3.js which allows headers to be set

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
0
Weekly downloads
 
Created
Source

A Replacement Web3.js HttpProvider supporting Adding HTTP Headers

This module can be used in place of HttpProvider from web3.

Once in place, the constructor offers a headers parameter that is a key/value object that has the headers to be set.

Using

First you need to grab the package:

npm install --save httpheaderhrovider

In your JavaScript project

```javascript
var Web3 = require('web3');
var web3 = new Web3();

var headerprovider = require('../lib');

var headers = {
  "header1": "valueOf1",
  "header2": "valueOf2"
}
var provider = new headerprovider('http://localhost:8545', headers);

web3.setProvider(provider);

var coinbase = web3.eth.coinbase;
console.log(coinbase);

var balance = web3.eth.getBalance(coinbase);
console.log(balance.toString(10));

Keywords

FAQs

Package last updated on 04 Dec 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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