ccoverstreet / Jablko

Smart Home Interface powered by Go.
MIT License
1 stars 0 forks source link

New IPC #114

Open ccoverstreet opened 3 years ago

ccoverstreet commented 3 years ago

Current IPC is just a REST API between Jablko and JMODs. One issue with this is that there JMODs have to send multiple identifiers to authenticate with Jablko. This is to prevent JMODs from pretending to be other JMODs. An easier way would be to use a persistent connection (like a WebSocket).

Right now, I think a good option would be to keep the HTTP proxy behavior of Jablko and use WebSockets to communicate between Jablko and JMODs. This way, WebSocket functionality is a minor addition and JMODs can still directly interact with the front-end through proxied requests.

A limitation of the HTTP REST approach is that raw byte data cannot be sent. Using WebSockets for IPC would also allow for Jablko to serve as a broker in a MQTT-like system that allows for arbitrary data formats (not restricted to text).