何かが欠けているに違いないと思いますが、チェックするデバッグ機能がありません。Web アプリは、socket.io を介して node.js サーバーにデータを渡しますが、何も送信しません。
サーバー.js
// Load required modules
var http = require("http"); // http server core module
var express = require("express"); // web framework external module
var io = require("socket.io"); // web socket external module
var easyrtc = require("easyrtc"); // EasyRTC external module
// Setup and configure Express http server. Expect a subfolder called "static" to be the web root.
var httpApp = express();
httpApp.use(express.static(__dirname + "/static/"));
// Start Express http server on port 8080
var webServer = http.createServer(httpApp).listen(8080);
// Start Socket.io so it attaches itself to Express server
var socketServer = io.listen(webServer, {"log level":1});
// Start EasyRTC server
var rtc = easyrtc.listen(httpApp, socketServer);
easyrtc.events.on('get_candy', function(easyrtc) {
easyrtc.events.emit('did it');
});
file.js
function joined_room() {
easyrtc.sendServerMessage('get_candy', {candy_name:'mars'},
function(msgType, msgData ) {
console.log("got candy count of " + msgData.barCount);
},
function(errorCode, errorText) {
console.log("error was " + errorText);
});
}
easyrtc.setServerListener( function(msgType, msgData, targeting) {
console.log("The Server sent the following message " + JSON.stringify(msgData));
}, 'get_candy');