eclipse-thingweb / node-wot

A fast and extensible framework to connect any device with your browser and backend applications
https://thingweb.io
Other
166 stars 80 forks source link

Multiplexing with WebSocket #128

Open sebastiankb opened 5 years ago

sebastiankb commented 5 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 5 years ago

Proposal:

egekorkan commented 5 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 5 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 5 years ago

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

egekorkan commented 5 years ago

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