OpenC3 / cosmos

OpenC3 COSMOS
https://openc3.com
Other
102 stars 29 forks source link

Websocket interface #580

Open bradenvirdellgenevatech opened 1 year ago

bradenvirdellgenevatech commented 1 year ago

Hello,

Was wondering if the TCP interface has the capability to be used as a websocket instead of just a TCP connection? If there is one could you point me to it and how to access it. From the documentation I have read I do not currently see one. The closest thing I have seen is a websocket stream but I do not know exactly how to access it or if I should.

Thanks, Braden Virdell

ryanmelt commented 1 year ago

I built the Websocket stream to support our websocket apis, and it could be pretty easily turned into an interface as well. Haven't done that yet though. I'll plan on working on this sometime after I implement the HttpInterface. Hopefully by end of month.

bradenvirdellgenevatech commented 1 year ago

Sounds good

ryanmelt commented 1 year ago

Reopening to capture the future websocket interface.

bradenvirdellgenevatech commented 8 months ago

Here is a simple websocket client, It can connect to 1 ws or wss at a time and talk back and forth relatively well. I needed to use the faye gem mainly due to it being the easiest websocket service I found with ruby. I have been using it for a few weeks now and haven't seen any major issues beyond the connection dying if it and the client haven't talked in a while. You can use this as a base if you wish, I'm sure there is a lot of improvement to be had.

Note: Had to turn it to a txt as Github wasnt taking the .rb file and the markdown was not formatting correctly

websocket_client_interface.txt