conflux-web-providers-http
This is a sub package of conflux-web
This is a HTTP provider for conflux-web.
Please read the documentation for more.
Installation
Node.js
npm install conflux-web-providers-http
In the Browser
Build running the following in the conflux-web repository:
npm run-script build-all
Then include dist/conflux-web-providers-http.js
in your html file.
This will expose the ConfluxWebHttpProvider
object on the window object.
Usage
// in node.js
var ConfluxWebHttpProvider = require('conflux-web-providers-http');
var options = {
timeout: 20000, // milliseconds,
headers: [{name: 'Access-Control-Allow-Origin', value: '*'},{...}]
};
var http = new ConfluxWebHttpProvider('http://localhost:8545', options);