eclipse-thingweb / node-wot

Components for building WoT devices or for interacting with them over various IoT protocols
https://thingweb.io
Other
161 stars 78 forks source link

Multiplexing with WebSocket #128

Open sebastiankb opened 4 years ago

sebastiankb commented 4 years ago

This problem is a placeholder that takes care of multiplexing with WebSockets.

So far node-wot consumer cannot distinguish between different events via WebSocket.

6d77 commented 4 years ago

Proposal:

egekorkan commented 4 years ago

A Data Schema based forwarding would be problematic when the Data Schemas are the same for multiple events. It is sadly quite common that people do not describe the payload detailed enough and simply say "type":"string" for all of them...

egekorkan commented 4 years ago

I think for anything over WebSocket, there has to be a subprotocol where the event data is always encapsulated with the interaction name and the type of the data, like event-data, event-unsubscription-output, action-output etc.

6d77 commented 4 years ago

We should look on some real-world examples. @sebastiankb , @wiresio could you provide something?

egekorkan commented 4 years ago

One real-world example is the Mozilla WebThing Websocket API: https://iot.mozilla.org/wot/#web-thing-websocket-api