susyweb-providers-ws
v1.0.0-beta.37
Published
Module to handle susyweb RPC connections over WebSockets.
Downloads
6
Readme
susyweb-providers-ws
This is a sub package of susyweb.js
This is a websocket provider for susyweb.js.
Please read the documentation for more.
Installation
Node.js
npm install susyweb-providers-ws
In the Browser
Build running the following in the susyweb.js repository:
npm run-script build-all
Then include dist/susyweb-providers-ws.js
in your html file.
This will expose the SusyWebWsProvider
object on the window object.
Usage
// in node.js
var SusyWebWsProvider = require('susyweb-providers-ws');
var options = { timeout: 30000, headers: {authorization: 'Basic username:password'} } // set a custom timeout at 30 seconds, and credentials (you can also add the credentials to the URL: ws://username:password@localhost:8546)
var ws = new SusyWebWsProvider('ws://localhost:8546', options);