I got this as below from backend developer:
session.publish('com.test.temp', [
temp,
humidity,
componentId,
componentType
], {}, { exclude_me: true });
So I succeed in a handshake with the server using WebSocket:
var ws = new WebSocket('ws://1server address','example.json');
ws.onopen = function () {
console.log('websocket is connected ...')
ws.send('connected')
}
ws.onmessage = function (ev) {
console.log(ev);
}
But I could not see any data in the console.log(ev)
How can I get JSON data from the server??