Websocket client Livecode
Posted: Mon Feb 13, 2023 6:14 pm
I've come to the point where I can not wait any longer for an LC websocket library. I need to have a websocket client in a Mac and Windows Livecode app. I have the sending side down it's the receiving of websocket events that I need to implement.
Before I start a proof of concept, I wanted to see what folks think of my logic to get this going in LC. It's a bit of a hack but seems plausible...
- use a hidden browser widget in the app
- write Javascript that handles all things needed for the websocket events listener, code will run in browser widget
- create an LC callback in the websocket event handler that sends the websocket message details to Livecode for processing/action.
My plain is to create an app where I can prove out the above using piesocket.com and the websocket tester they offer.
I've not done anything with JS in a LC client app before. I do a lot with JS in my professional career. I think a callback is possible from JS to LC. That's the one piece I'm a little unsure of.
Does anyone have any thoughts on if my steps seem reasonable? If I can get this working I'll share a write-up and my POC stack for folks to try it out.
Thanks in advance,
Bob
Manchester, NH, US
Before I start a proof of concept, I wanted to see what folks think of my logic to get this going in LC. It's a bit of a hack but seems plausible...
- use a hidden browser widget in the app
- write Javascript that handles all things needed for the websocket events listener, code will run in browser widget
- create an LC callback in the websocket event handler that sends the websocket message details to Livecode for processing/action.
My plain is to create an app where I can prove out the above using piesocket.com and the websocket tester they offer.
I've not done anything with JS in a LC client app before. I do a lot with JS in my professional career. I think a callback is possible from JS to LC. That's the one piece I'm a little unsure of.
Does anyone have any thoughts on if my steps seem reasonable? If I can get this working I'll share a write-up and my POC stack for folks to try it out.
Thanks in advance,
Bob
Manchester, NH, US