Closed odensc closed 10 years ago
Never mind. Figured out how to do it. For those wondering: Node:
exports.socketio_routes = [
{
key: "msg",
handler: "msg_handler"
},
];
exports.msg_handler = function(socket, data)
{
socket.emit("appdata",
{
appid: exports.settings.appname,
key: "msg",
data: data
});
};
JS:
$(function()
{
Coder.socketConnection.init();
Coder.socketConnection.addListener("msg", function(data)
{
console.log(data);
});
$("#btn").click(function()
{
Coder.socketConnection.sendData("msg", "hi!");
});
});
I see there is some things for socket.io, like socketio_routes and Coder.socketConnection. Is there any documentation for this stuff?