Created
November 15, 2018 17:42
-
-
Save itsdevcoffee/d8d334ce6973a05ee9c1f769880996f9 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> | |
<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