forked from pubnub/javascript
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcrypto-check.js
More file actions
44 lines (32 loc) · 972 Bytes
/
Copy pathcrypto-check.js
File metadata and controls
44 lines (32 loc) · 972 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* ---------------------------------------------------------------------------
Init PubNub and Get your PubNub API Keys:
http://www.pubnub.com/account#api-keys
--------------------------------------------------------------------------- */
var PUBNUB = require("../pubnub.js")
var pubnub = PUBNUB({
publish_key : "demo",
subscribe_key : "demo"
});
var pubnub_enc = PUBNUB({
publish_key : "demo",
subscribe_key : "demo",
cipher_key : "demo"
});
pubnub.subscribe({
channel : "abcd",
callback : function(message) {
console.log( typeof message + " > " + JSON.stringify(message) );
},
error : function(r) {
console.log(JSON.stringify(r));
},
});
pubnub_enc.subscribe({
channel : "abcd-enc",
callback : function(message) {
console.log( 'enc : ' + typeof message + " > " + JSON.stringify(message) );
},
error : function(r) {
console.log(JSON.stringify(r));
},
});