Skip to content

Instantly share code, notes, and snippets.

@itsdevcoffee
Created November 15, 2018 17:42
Show Gist options
  • Save itsdevcoffee/d8d334ce6973a05ee9c1f769880996f9 to your computer and use it in GitHub Desktop.
Save itsdevcoffee/d8d334ce6973a05ee9c1f769880996f9 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<head>
<title>Pusher Test</title>
<script src="https://js.pusher.com/4.3/pusher.min.js"></script>
<script>
// Enable pusher logging - don't include this in production
Pusher.logToConsole = true;
var pusher = new Pusher('84e09133c83ec81132c9', {
cluster: 'us2',
forceTLS: true
});
var channel = pusher.subscribe('my-channel');
channel.bind('my-event', function(data) {
alert(JSON.stringify(data));
});
</script>
</head>
<body>
<h1>Pusher Test</h1>
<p>
Try publishing an event to channel <code>my-channel</code>
with event name <code>my-event</code>.
</p>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment