-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
29 lines (26 loc) · 749 Bytes
/
server.js
File metadata and controls
29 lines (26 loc) · 749 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
var io = require('socket.io')()
io.on('connection', function (socket) {
console.log("new connection");
socket.on('log', function(data) { console.log(data) });
socket.on('insert', function(data) {
console.log('insert', data);
io.emit('insert', data);
});
socket.on('select', function(data) {
console.log('select', data);
io.emit('select', data);
});
socket.on('release', function(data) {
console.log('release', data);
io.emit('release', data);
});
socket.on('distance', function (data) {
console.log('distance', data);
io.emit('translateY', data);
});
socket.on('orientation', function(data) {
console.log('orientation', data);
io.emit('orientation', data);
});
});
io.listen(5000);