Waziup / WaziCloud

WAZIUP Cloud and local platform
31 stars 28 forks source link

WebSocket support, live data subscriptions #151

Closed j-forster closed 6 years ago

j-forster commented 7 years ago

For now, subscriptions to the fiware-orion broker will trigger an http request to a given endpoint. This method is not usable for wep app clients, that can not function as an http server.
See https://github.com/telefonicaid/fiware-orion/issues/1181 It seems like WebSocket has not been implemented yet. As a solution to this, a WebSocket gateway can functions as a bridge between the clients and the broker.

WebSocket gateway

The gateway should connect

In order to listen for data changes, the client can open a websocket connection to the ws-gateway. The gateway makes a subscription to the broker, and will pass any data-changes to the client via ws. Closing the websocket connection will make the broker unsubscribe the previously create subscriptions. Web Client <===WebSocket===> WS-Gateway <---HTTP---> Broker
What is your opinion? I think, a Waziup WS-Gateway can boost the WebApps enormously.

cdupont commented 7 years ago

Actually it seems that the bulk of the work is done in Orion: https://github.com/telefonicaid/fiware-orion/issues/1669 Only documentation, tests, style and some configuration aspects are pending. Probably we can get the feature in HEAD, perhaps compiling with some flags. Tell me what you think.

j-forster commented 7 years ago

Your right @cdupont, I didn't see the progress that they made. I would really appreciate this feature, because it will be really useful and it's the only way to monitor live data within WebApps.

Is there any chance of enabling this feature with the Waziup broker?

cdupont commented 7 years ago

There is already the HEAD of Orion in Waziup... Maybe the feature is already present? Could you check?

j-forster commented 7 years ago

It is in a different branch: https://github.com/telefonicaid/fiware-orion/tree/feature/1181_websockets But this branch is far behind master.. However, I tested ws://broker.waziup.io and ws://broker.waziup.io:9010 - both don't connect.

j-forster commented 7 years ago

So we're back where the question began: Interested in a WebSocket gateway?

ARBISWAS commented 7 years ago

It is a good idea to integrate the WebScoket in WAZIUP platform

cdupont commented 7 years ago

Orion dev replied: https://github.com/telefonicaid/fiware-orion/issues/1181#issuecomment-302470456 They will not integrate websockets in the foreseeable future. So let's go with a web socket gateway!

cdupont commented 6 years ago

closing as too old. Let's reopen another issue if still needed.