I tried to implement textroom via websocket as below.
websocket = new WebSocket('ws://myserver:8188', 'janus-protocol');
websocket.onopen = function(e) {
websocket.send(JSON.stringify({"textroom" : "list",});
};
But I got below error message.
{
"janus": "error",
"error": {
"code": 456,
"reason": "Missing mandatory element (transaction)"
}
}
so I added transaction and tried again
websocket.send(JSON.stringify({
"textroom" : "list",
"transaction" : "1234567890ab"
});
And I got below error message.
{
"janus": "error",
"error": {
"code": 456,
"reason": "Missing mandatory element (janus)"
}
}
I have used “janus” element when I create videoroom via websocket.
Can I use websocket to implement textroom for text chatting?