nodejs with express server, leapmotion for movement control, and threejs for 3d render

This commit is contained in:
idoctnef
2016-05-30 18:14:08 +02:00
parent e2aeac1bae
commit 52b63ee33a
893 changed files with 127726 additions and 0 deletions

17
node_modules/ws/examples/serverstats/package.json generated vendored Normal file
View File

@@ -0,0 +1,17 @@
{
"author": "",
"name": "serverstats",
"version": "0.0.0",
"repository": {
"type": "git",
"url": "git://github.com/einaros/ws.git"
},
"engines": {
"node": ">0.4.0"
},
"dependencies": {
"express": "2.x"
},
"devDependencies": {},
"optionalDependencies": {}
}

33
node_modules/ws/examples/serverstats/public/index.html generated vendored Normal file
View File

@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html>
<head>
<style>
body {
font-family: Tahoma, Geneva, sans-serif;
}
div {
display: inline;
}
</style>
<script>
function updateStats(memuse) {
document.getElementById('rss').innerHTML = memuse.rss;
document.getElementById('heapTotal').innerHTML = memuse.heapTotal;
document.getElementById('heapUsed').innerHTML = memuse.heapUsed;
}
var host = window.document.location.host.replace(/:.*/, '');
var ws = new WebSocket('ws://' + host + ':8080');
ws.onmessage = function (event) {
updateStats(JSON.parse(event.data));
};
</script>
</head>
<body>
<strong>Server Stats</strong><br>
RSS: <div id='rss'></div><br>
Heap total: <div id='heapTotal'></div><br>
Heap used: <div id='heapUsed'></div><br>
</body>
</html>

19
node_modules/ws/examples/serverstats/server.js generated vendored Normal file
View File

@@ -0,0 +1,19 @@
var WebSocketServer = require('../../').Server
, http = require('http')
, express = require('express')
, app = express.createServer();
app.use(express.static(__dirname + '/public'));
app.listen(8080);
var wss = new WebSocketServer({server: app});
wss.on('connection', function(ws) {
var id = setInterval(function() {
ws.send(JSON.stringify(process.memoryUsage()), function() { /* ignore errors */ });
}, 100);
console.log('started client interval');
ws.on('close', function() {
console.log('stopping client interval');
clearInterval(id);
})
});