OBS websocket client with XOJO

I am working in a remote control for OBS, by means of the websocket plugin, which works in port 4444 of the local or lan computer.
I try connecting via tcpsocket, with the 127.0.0.1 or 192.etc. address and port 4444, it connects but, within a two seconds it generates an error.
Any tips?
regards

Maybe this will help.

great!!!
as soon as I test it i will comment again
thanks

hello, back home!

As time passes by, and when possible, an old project of interacting with obs in a deckstream fashin from a webapp, wakes up and goes to sleep again many times.

Now that IA is around i even try with it, it keeps providing me with soultions that, when checked, are visuabasic.net code. When insist in that i need xojo code, provides me with coding that definitly does not work.

One thing that i have to clarify is that i am still coding with xojo 2016 r3. Why? simple answer, i have been wating for support for android… not available yet.

Although i have find a solution with “shell” in a xojo webapplication and it works, the concept (my view point) is a little bit ill.

A call shell from xojo (more code is needed for the call and the retrieve of data when needed than all the called code) yes to phyton yes, simple, easy and works.


import websocket
import json

# Create a websocket connection to OBS Studio
ws = websocket.create_connection("ws://localhost:4444")

# Send a "start-recording" message
msg = {
    "request-type": "StartRecording",
    "source": "sbradio",
    "message-id": "101"
}
ws.send(json.dumps(msg))
response = ws.recv()
print(response)
ws.close()

for this simple action (star recording), is there a simple xojo code?
hope yes!

regards