Skip to content

Instantly share code, notes, and snippets.

@truemagic-coder
Last active September 10, 2015 00:26
Show Gist options
  • Save truemagic-coder/f6e1007a0604a24c8089 to your computer and use it in GitHub Desktop.
Save truemagic-coder/f6e1007a0604a24c8089 to your computer and use it in GitHub Desktop.
<!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>
@stephenlb
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment