//サーバー側
var http     = require('http');
var socketio = require('socket.io');
var fs       = require('fs');
var server   = http.createServer(function(req, res) {
    res.writeHead(200, {'Content-Type' : 'text/html'});
    res.end(fs.readFileSync(__dirname + '/index.html', 'utf-8'));
}).listen(3000);  // ポート競合の場合は値を変更

var io = socketio.listen(server);

io.sockets.on('connection', function(socket) {
  console.log('connection');
    socket.on('send_Temperature',function(msg){socket.broadcast.emit('q',msg);});
    socket.on('send_PRbpm',function(msg){socket.broadcast.emit('w',msg);});

});
