# platon-web3-providers-http

> Module to handle web3 RPC connections over HTTP.

Latest version **1.2.4** (published 2021-12-28) · LGPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install platon-web3-providers-http
pnpm add platon-web3-providers-http
yarn add platon-web3-providers-http
bun add platon-web3-providers-http
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; popular repo.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.4 |
| Published | 2021-12-28 |
| First published | 2021-12-28 |
| Weekly downloads | 0 |
| License | LGPL-3.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=8.0.0 |
| Dependencies | 2 |
| Unpacked size | 8.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 19907 |
| Maintainers | rileyge |

## Links

- npm: https://www.npmjs.com/package/platon-web3-providers-http
- Repository: https://github.com/ethereum/web3.js/tree/1.x/packages/web3-providers-http
- npm.io page: https://npm.io/package/platon-web3-providers-http

## Dependencies (2)

- [xhr2-cookies](https://npm.io/package/xhr2-cookies.md) 1.1.0
- [platon-web3-core-helpers](https://npm.io/package/platon-web3-core-helpers.md) 1.2.4

## Recent versions

- 1.2.4 (latest) — 2021-12-28
- 1.2.7-beta.0 (beta) — 2021-12-29

## README

# web3-providers-http

_This is a sub package of [web3.js][repo]_

This is a HTTP provider for [web3.js][repo].  
Please read the [documentation][docs] for more.

## Installation

### Node.js

```bash
npm install web3-providers-http
```

### In the Browser

Build running the following in the [web3.js][repo] repository:

```bash
npm run-script build-all
```

Then include `dist/web3-providers-http.js` in your html file.
This will expose the `Web3HttpProvider` object on the window object.

## Usage

```js
// in node.js
var Web3HttpProvider = require('web3-providers-http');

var options = {
    timeout: 20000, // milliseconds,
    headers: [{name: 'Access-Control-Allow-Origin', value: '*'},{...}]
};
var http = new Web3HttpProvider('http://localhost:8545', options);
```

## Types

All the typescript typings are placed in the types folder.

[docs]: http://web3js.readthedocs.io/en/1.0/
[repo]: https://github.com/ethereum/web3.js

---
_Source: https://npm.io/package/platon-web3-providers-http · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
