Socket
Socket
Sign inDemoInstall

pubnub

Package Overview
Dependencies
Maintainers
1
Versions
224
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pubnub - npm Package Compare versions

Comparing version 3.6.1 to 3.6.2

examples/crypto-check.js

2

examples/ptest.js

@@ -57,3 +57,3 @@ var clOptions = [];

if (clOptions[3] == "beta") {
config.origin = "presence-beta.pubnub.com";
config.origin = "pubsub.pubnub.com";
} else {

@@ -60,0 +60,0 @@ config.origin = "pubsub.pubnub.com";

@@ -17,10 +17,17 @@ /* ---------------------------------------------------------------------------

--------------------------------------------------------------------------- */
function publish(channel, msg) {
pubnub.publish({
channel : "JAY",
message : "askldjflksjd_POST",
channel : channel,
message : msg,
callback : log,
error : retry
});
}
function log(e) { console.log(e) }
function retry() { console.log('retry?') }
for (var i = 0; i < 1000; i++) {
publish('dsm-test',i);
}
{
"name": "pubnub",
"preferGlobal": false,
"version": "3.6.1",
"version": "3.6.2",
"author": "PubNub <stephen@pubnub.com>",

@@ -6,0 +6,0 @@ "description": "Publish & Subscribe Real-time Messaging with PubNub",

@@ -1,2 +0,2 @@

// Version: 3.6.1
// Version: 3.6.2
var NOW = 1

@@ -15,3 +15,3 @@ , READY = false

, PRESENCE_HB_DEFAULT = 30
, SDK_VER = '3.6.1'
, SDK_VER = '3.6.2'
, REPL = /{([\w\-]+)}/g;

@@ -352,3 +352,4 @@

function _invoke_error(response,err) {
if (typeof response == 'object' && response['error']) {
if (typeof response == 'object' && response['error'] &&
response['message'] && response['payload']) {
err({'message' : response['message'], 'payload' : response['payload']});

@@ -740,3 +741,4 @@ } else err(response);

'channel' : channel + PRESENCE_SUFFIX,
'callback' : presence
'callback' : presence,
'restore' : restore
});

@@ -900,7 +902,3 @@

var decrypted_msg = decrypt(msg,CHANNELS[next[1]]['cipher_key']);
try {
next[0]( JSON['parse'](decrypted_msg), messages, next[1], latency );
} catch (e) {
next[0]( decrypted_msg, messages, next[1], latency );
}
next[0]( decrypted_msg, messages, next[1], latency);
});

@@ -1084,17 +1082,16 @@

, sign_input = SUBSCRIBE_KEY + "\n" + PUBLISH_KEY + "\n"
+ "grant" + "\n"
+ ((
(auth_key && encode(auth_key).length > 0) ?
"auth=" + encode(auth_key) + "&" :
""
))
+ "channel=" + encode(channel) + "&"
+ "pnsdk=" + encode(PNSDK) + "&"
+ "grant" + "\n";
if (auth_key) sign_input += ("auth=" + encode(auth_key) + "&");
if (jsonp != '0') sign_input += ("callback=" + encode(jsonp) + "&") ;
if (channel) sign_input += ("channel=" + encode(channel) + "&") ;
sign_input += "pnsdk=" + encode(PNSDK) + "&"
+ "r=" + r + "&"
+ "timestamp=" + encode(timestamp);
if (ttl || ttl === 0) sign_input += "&" + "ttl=" + ttl;
sign_input += "&" + "w=" + w;
var signature = hmac_SHA256( sign_input, SECRET_KEY );

@@ -1162,2 +1159,3 @@

if (auth_key) sign_input += ("auth=" + encode(auth_key) + "&");
if (jsonp != '0') sign_input += ("callback=" + encode(jsonp) + "&") ;
if (channel) sign_input += ("channel=" + encode(channel) + "&") ;

@@ -1251,3 +1249,3 @@

'grep' : grep,
'offline' : function(){_reset_offline(1)},
'offline' : function(){_reset_offline(1, { "message":"Offline. Please check your network settings." })},
'supplant' : supplant,

@@ -1352,3 +1350,3 @@ 'now' : rnow,

, SECOND = 1000
, PNSDK = 'PubNub-JS-' + 'Nodejs' + '/' + '3.6.1'
, PNSDK = 'PubNub-JS-' + 'Nodejs' + '/' + '3.6.2'
, crypto = require('crypto')

@@ -1523,3 +1521,3 @@ , XORIGN = 1;

}
return decrypted;
return JSON.parse(decrypted);
}

@@ -1526,0 +1524,0 @@ }

@@ -27,2 +27,13 @@ # PubNub Node.JS SDK and NPM

/* ---------------------------------------------------------------------------
Publish Messages
--------------------------------------------------------------------------- */
var message = { "some" : "data" };
pubnub.publish({
channel : 'my_channel',
message : message,
callback : function(e) { console.log( "SUCCESS!", e ); },
error : function(e) { console.log( "FAILED! RETRY PUBLISH!", e ); }
});
/* ---------------------------------------------------------------------------
Listen for Messages

@@ -47,2 +58,4 @@ --------------------------------------------------------------------------- */

});
```

@@ -211,3 +211,3 @@ /* ---------------------------------------------------------------------------

}
return decrypted;
return JSON.parse(decrypted);
}

@@ -214,0 +214,0 @@ }

Sorry, the diff of this file is too big to display

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