-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.html
More file actions
33 lines (28 loc) · 680 Bytes
/
index.html
File metadata and controls
33 lines (28 loc) · 680 Bytes
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
32
33
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>SocketIO Test</title>
</head>
<body>
Socket.io test page
<script src="/ws/socket.io.js"></script>
<script>
/* global io */
'use strict';
// log socket.io debug messages
// localStorage.setItem( 'debug', 'socket.io-client:*,-socket.io-client:socket' );
var s = io( '', {
path : '/ws',
transports : ['polling', 'websocket'],
// reconnection : false,
});
s.on( 'connect_error', function ( err ) {
console.warn( 'Socket Connection Error', err );
});
s.on( 'msg', function ( msg ) {
console.log( 'Incoming message: "%s"', msg );
});
</script>
</body>
</html>