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

web3-providers-ws

Package Overview
Dependencies
Maintainers
1
Versions
458
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

web3-providers-ws - npm Package Compare versions

Comparing version 1.0.0-beta.35 to 1.0.0-beta.36

4

package.json
{
"name": "web3-providers-ws",
"namespace": "ethereum",
"version": "1.0.0-beta.35",
"version": "1.0.0-beta.36",
"description": "Module to handle web3 RPC connections over WebSockets.",

@@ -11,5 +11,5 @@ "repository": "https://github.com/ethereum/web3.js/tree/master/packages/web3-providers-ws",

"underscore": "1.8.3",
"web3-core-helpers": "1.0.0-beta.35",
"web3-core-helpers": "1.0.0-beta.36",
"websocket": "git://github.com/frozeman/WebSocket-Node.git#browserifyCompatible"
}
}

@@ -32,3 +32,5 @@ /*

if (typeof window !== 'undefined' && typeof window.WebSocket !== 'undefined') {
Ws = window.WebSocket;
Ws = function(url, protocols) {
return new window.WebSocket(url, protocols);
};
_btoa = btoa;

@@ -79,4 +81,12 @@ parseURL = function(url) {

this.connection = new Ws(url, protocol, undefined, headers);
// Allow a custom client configuration
var clientConfig = options.clientConfig || undefined;
// When all node core implementations that do not have the
// WHATWG compatible URL parser go out of service this line can be removed.
if (parsedURL.auth) {
headers.authorization = 'Basic ' + _btoa(parsedURL.auth);
}
this.connection = new Ws(url, protocol, undefined, headers, undefined, clientConfig);
this.addDefaultEvents();

@@ -105,3 +115,3 @@

// notification
if(!id && result.method.indexOf('_subscription') !== -1) {
if(!id && result && result.method && result.method.indexOf('_subscription') !== -1) {
_this.notificationCallbacks.forEach(function(callback){

@@ -388,2 +398,8 @@ if(_.isFunction(callback))

WebsocketProvider.prototype.disconnect = function () {
if (this.connection) {
this.connection.close();
}
};
module.exports = WebsocketProvider;
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