forked from abhishiv/pusher-lite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
31 lines (25 loc) · 845 Bytes
/
test.js
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
// Generated by CoffeeScript 1.3.3
(function() {
var PusherClient, pres, pusher_client;
PusherClient = require('./lib/pusher-node-client').PusherClient;
pusher_client = new PusherClient({
appId: process.env.PUSHER_APP_ID || app_id,
key: process.env.PUSHER_KEY || pusher_key,
secret: process.env.PUSHER_SECRET || pusher_secret
});
pres = null;
pusher_client.on('connect', function() {
pres = pusher_client.subscribe("presence-users", {
user_id: "system"
});
return pres.on('success', function() {
pres.on('pusher_internal:member_removed', function(data) {
return console.log("member_removed");
});
return pres.on('pusher_internal:member_added', function(data) {
return console.log("member_added");
});
});
});
pusher_client.connect();
}).call(this);