Ayanami d55ca374e4 Use merkle tree from npm & remove ./lib 3 anos atrás
..
lib 2c173c6300 Add local modules to fix http headers privacy problem 3 anos atrás
local_modules d55ca374e4 Use merkle tree from npm & remove ./lib 3 anos atrás
src 2c173c6300 Add local modules to fix http headers privacy problem 3 anos atrás
types 2c173c6300 Add local modules to fix http headers privacy problem 3 anos atrás
README.md 2c173c6300 Add local modules to fix http headers privacy problem 3 anos atrás
package-lock.json 2c173c6300 Add local modules to fix http headers privacy problem 3 anos atrás
package.json d55ca374e4 Use merkle tree from npm & remove ./lib 3 anos atrás
tsconfig.json d55ca374e4 Use merkle tree from npm & remove ./lib 3 anos atrás

README.md

web3-providers-http

NPM Package Dependency Status Dev Dependency Status

Package forked from https://github.com/ChainSafe/web3.js/tree/v1.6.1/packages/web3-providers-http to change http headers

This is a HTTP provider sub-package for web3.js.

Please read the documentation for more.

Installation

Node.js

npm install web3-providers-http

Usage

const http = require('http');
const Web3HttpProvider = require('web3-providers-http');

const options = {
    keepAlive: true,
    timeout: 20000, // milliseconds,
    headers: [{name: 'Access-Control-Allow-Origin', value: '*'},{...}],
    withCredentials: false,
    agent: {http: http.Agent(...), baseUrl: ''}
};

const provider = new Web3HttpProvider('http://localhost:8545', options);

Types

All the TypeScript typings are placed in the types folder.