CURLSMBS, WebSockets and OBS

Hi all,

Trying to build a small app to have some control over OBS (Open Broadcaster Software) and so far I can open the connection and then get a response. When I try to send the next command to identify myself, I keep getting back an error 1002, and “Invalid use of reserved bit”, which seems to point to data it can’t process.

I’m sending back json on my WebSocketSend method (even copying from test sites that work in JavaScript).

Anyone cracked this with MBS or other WebSocket stuff? Searching I see attempts, and AI models have failed me with Xojo :slight_smile:

Have you tried:

2 Likes

I did download it but decided at the time, it was too much of a science project as little documentation.

Now that said, after WireSharking the CURLSMBS data flows, I have fallen into that rabbit hole. I can see that the WebSocketSend method appears to seen as just data and not a WebSocket transaction by WireShark. Probably just me and the options.

So, I will revisit that WebSocket class and see if I get further. Thanks Greg.

I did try again with the WebSocket class and getting some success. I had to step through the websocket validate class and comment out this line,

data = data.DefineEncoding( Encodings.UTF8 )

seems it stripped out some stuff that OBS returned on the connect so I’m getting a lot further. Thanks

1 Like

I’ve marked this as resolved. Using kteninay’s class is actually straightforward and so far has worked solidly.

2 Likes

@Richard_Gorbutt I haven’t been able to make this work with kteninay’s class. do you mind sharing what you did? Thanks

Hi,

I had to comment out the line below in ValidateHandShake method in the WebSocket _MTC class and then it worked.

I created a class in my form called WS with a super of M_WebSocket.WebSocket_MTC. Then I called ws://localhost:4455. I was able to write to the socket and then used dataAvailable event to process the return.