Skip to content

Instantly share code, notes, and snippets.

@stephenlb
Last active August 29, 2015 13:57
Show Gist options
  • Select an option

  • Save stephenlb/9498867 to your computer and use it in GitHub Desktop.

Select an option

Save stephenlb/9498867 to your computer and use it in GitHub Desktop.
PubNub CNAME Example Origin Usage
<script src=http://cdn.pubnub.com/pubnub.min.js></script>
<script>(function(){
var thespiral = PUBNUB.init({
publish_key : 'demo',
subscribe_key : 'demo',
origin : 'live.thespiral.org', // > dig live.thespiral.org
});
thespiral.subscribe({
channel : 'my_channel',
connect : function() { /* ... */ },
callback : function(message) {
alert(JSON.stringify(message));
}
});
})();</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment