servidor funciona, gpio desabilitat

This commit is contained in:
nau
2016-06-21 18:42:57 +02:00
parent b5a55ed6b1
commit 4825f68edf
874 changed files with 109057 additions and 0 deletions

21
node_modules/ws/examples/serverstats-express_3/server.js generated vendored Executable file
View File

@@ -0,0 +1,21 @@
var WebSocketServer = require('../../').Server
, http = require('http')
, express = require('express')
, app = express();
app.use(express.static(__dirname + '/public'));
var server = http.createServer(app);
server.listen(8080);
var wss = new WebSocketServer({server: server});
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);
});
});