Last active
September 10, 2015 00:26
-
-
Save truemagic-coder/f6e1007a0604a24c8089 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Hello Punub</title> | |
</head> | |
<body> | |
<script src="https://cdn.pubnub.com/pubnub-3.7.14.min.js"></script> | |
<h1>Hello</h1> | |
</body> | |
<script> | |
pubnub = PUBNUB.init({ | |
publish_key: 'pub key', | |
subscribe_key: 'sub-key', | |
ssl: true | |
}) | |
console.log('init') | |
pubnub.subscribe({ | |
channel: "your channel", | |
message: function (dispatch, env, channel){ | |
console.log(dispatch, env, channel) | |
} | |
}) | |
</script> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Found an important issue with your test!
console.log(...)
will cause memory ballooning. This is a common issue https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=console.log%20memory%20usage - so make sure to remove this when testing.