-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
31 lines (29 loc) · 889 Bytes
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script src="https://js.pusher.com/7.0/pusher.min.js"></script>
</head>
<body>
<script>
let client = new Pusher('app-key', {
wsHost: '127.0.0.1',
wsPort: 6001,
forceTLS: false,
encrypted: true,
disableStats: true,
enabledTransports: ['ws', 'wss'],
});
client.connection.bind( 'error', function( err ) {
console.log(err)
});
client.subscribe('my-channel').bind('my_event', (message) => {
console.log(message)
});
</script>
</body>
</html>