Make it possible to broadcast messages (data) to other websocket clients#354
Conversation
Palakis
left a comment
There was a problem hiding this comment.
Thanks for this! Here is some feedback regarding these changes:
|
@Palakis Thank you for your review. I made the requested changes. |
|
@Palakis I was thinking about this. I think it would be neat if the broadcast would contain a identifier (e.g. the string from getRemoteEndpoint) for the source and the possibility to then send a response to just this source (so another request SendWebSocketMessage which gets realm, data and target). However to do this the source string (or the connection_hdl) would need to be available in the RequestHandler. This should be doable but what are your feelings about this idea? |
Palakis
left a comment
There was a problem hiding this comment.
Thanks for the changes! Everything is good, just a few things I didn't catch before regarding documentation and naming.
Palakis
left a comment
There was a problem hiding this comment.
Almost good! Gonna run a last batch of tests after that.
|
@Palakis Something went wrong with the automatic protocol.md generation. The entry in event section is missing the return values and the entry in the command section is missing alltogether. |
|
@julijane Both the command spec used |
|
@Palakis Oops i'm sorry for that mistake. Thanks for fixing already! |
|
@Palakis You made a mistake though, see PR |
This PR adds a new function "BroadcastWebSocketMessage" which takes two parameters: realm and data. realm is intended to be a user-defined string to distinguish the source/recipient/scope of the message and data is the actual message.
Why?
With this change for example a javascript code in a browser source can connect to the websocket server and can receive such Messages and act upon them. This makes it possible for example to write some remote controlling software which triggers actions in a browser source without the need for any additional server.