New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

angular-websocket

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-websocket - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

example/index.html

33

angular-websocket.js

@@ -14,5 +14,5 @@ ;(function(module, undefined) {

this.url = function(url, protocols) {
this.uri = function(uri, protocols) {
protocols = Array.prototype.slice.call(arguments, 1);
_WebSocket = new WebSocket(url, protocols);
_WebSocket = new WebSocket(uri, protocols);
return this;

@@ -37,4 +37,5 @@ };

event = event && 'on'+event || 'onmessage';
return function(eventName, callback) {
ws[event](eventName, asyncAngularify(callback));
return function(callback) {
ws[event] = asyncAngularify(callback);
return this;
};

@@ -44,3 +45,5 @@ };

var wrappedWebSocket = {
on: addListener('message'),
on: function(event) {
return addListener(event);
},
onmessage: addListener('message'),

@@ -50,16 +53,16 @@ onclose: addListener('close'),

onerror: addListener('error'),
new: function(uri, protocols) {
protocols = Array.prototype.slice.call(arguments, 1);
ws = new WebSocket(url, protocols);
return this;
},
close: function() {
ws.close();
return this
},
send: function(eventName, data, callback) {
if (angular.isObject(eventName)) {
ws.send(eventName);
} else {
if (callback) {
ws.send(eventName, data, asyncAngularify(callback));
} else {
ws.send(eventName, data);
}
}
send: function(message) {
message = Array.prototype.slice.call(arguments);
ws.send.apply(ws, message);
return this;
},

@@ -66,0 +69,0 @@

{
"name": "angular-websocket",
"version": "0.0.1",
"version": "0.0.2",
"homepage": "https://github.com/gdi2290/angular-websocket",

@@ -20,4 +20,4 @@ "authors": [

"dependencies": {
"angular": "~1.2.0"
"angular": "*"
}
}
{
"name": "angular-websocket",
"version": "0.0.1",
"version": "0.0.2",
"main": "angular-websocket.js",

@@ -5,0 +5,0 @@ "description": "WebSocket service for Angular.js",

@@ -27,3 +27,3 @@ # Work in progress

.prefix('')
.url('ws://localhost:8080');
.uri('ws://echo.websocket.org/');
});

@@ -38,2 +38,8 @@

WebSocket.onmessage(function(event) {
console.log('message: ', event.data);
});
});

@@ -40,0 +46,0 @@ </script>

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