obs-websocket.js in OBS 28

danma06

New Member
I know I'm missing something. Looks like javascript had some major overhaul over the years. And now javascript is meant to be run through a nodejs? I have no idea what any of this means.

I just know, I used to use a:

<script type='text/javascript' src='obs-websocket.js'></script>

in my HTML code to include the old obs-websocket 4.0 stuff that allowed me to write javascript code to connect to the web socket in OBS < version 28.

But starting with OBS 28, the websocket stuff is included in OBS and uses obs-websocket 5.0?

At any rate... how do I do this with OBS 28.0 and obs-websocket 5?

I cannot for the life of me figure out how to render this javascript in an html based page. I guess I'm just too old and dumb to figure it out.

Is there not an obs-websocket.js for version 5 that can be included in a <script> tag as above?
 

danma06

New Member
In case anyone is wondering, I was able to figure this out. It's one of those where you want to hide under the covers in embarrassment.

I was using

obs.connect({ address: '127.0.0.1:4444' });

to connect with websocket 5. That's what I had been using in websocket 4. Turns out this needs to be:

obs.connect('ws://127.0.0.1:4444');

in websocket 5. That's where the error was at.
 
Top