Last active
April 8, 2020 21:35
-
-
Save emilianobilli/9b2424b128ed1e9ed062afa60a27a6ce to your computer and use it in GitHub Desktop.
This file contains 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/5.1/pusher.min.js"></script> | |
<script> | |
// Enable pusher logging - don't include this in production | |
Pusher.logToConsole = true; | |
var pusher = new Pusher('6c3d25b9b072a4c03090', { | |
cluster: 'us2', | |
forceTLS: true | |
}); | |
var channel = pusher.subscribe('my-channel'); | |
channel.bind('my-event', function(data) { | |
console.log(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