Created Websockets (markdown)

WarmUpTill 2022-08-25 20:22:53 +02:00
parent 1b86113131
commit a444876784

55
Websockets.md Normal file

@ -0,0 +1,55 @@
# Websockets
It is possible to use the [macros](Macros) system to communicate with remote OBS instances using version 5.0 of the obs-websockets plugin.
Since version 28 of OBS the obs-websocket plugin is shipped with OBS itself so there is no need to install anything for this functionality.
To receive messages the [macro](Macros) condition "Websocket" can be used.
To send messages to other OBS instances the [macro](Macros) action "Websocket" can be used.
## Websocket condition
![WebsocketCondition](https://user-images.githubusercontent.com/19472752/186740224-38f1d111-0aef-41e0-aa1c-56c77e5088ab.PNG)
This condition type will allow you to perform actions if certain messages or patterns are received from other OBS instances.
Simply enter the desired message into the text field (1).
If applicable check (2) to interpret the message as pattern to match incoming messages against.
If a matching message was received the condition will return true for the interval the message was received in.
## Websocket action
![WebsocketAction](https://user-images.githubusercontent.com/19472752/186740247-e0994824-2a5b-497d-920a-eff5417ea7da.PNG)
This action type will allow you to send messages to other OBS instances which could then trigger [macros](Macros) on the remote OBS instance.
First select the connection you want to send the message to (1).
For more details on how to configure connections have a look at the upcoming sections.
Next enter the message you want to send in the text field at (2).
### Adding new connections
A new connection can be added to a websocket action by clicking on the "Add new connection" entry in the connection selection menu.
![AddConnection](https://user-images.githubusercontent.com/19472752/186740289-c8782b92-68c5-444f-af4d-4166f86e1213.png)
When selecting this entry a dialog will open in which you will have to enter the connection details:
![AddConnectionDialog](https://user-images.githubusercontent.com/19472752/186740360-055b39c3-8f5d-4107-959f-5de9d0a59cd7.PNG)
* Unique name for this new connection (1).
* The address to connection to (2).
* The port to connect to on the specified address (3).
* The password required to connect to the websocket server (4).
* If you would like the plugin to automatically attempt to connect on OBS startup check (5).
* If you want the plugin to automatically attempt to reconnect once the connection is lost check (6) and enter the desired time after which reconnecting should be attempted.
* Finally you can check if the entered connection details are valid by clicking on the "Test connection" button (7).
If the status message reports "Connected and authenticated" all is well.
### Modifying existing connections
![ModifyConnection](https://user-images.githubusercontent.com/19472752/186740377-68bfaaa6-e43c-4163-929d-2c3012b7287d.png)
To modify the connection details of an existing connection simply select it in the drop down menu of a websocket action and click the marked gear symbol.
Next click the "Properties" entry and a dialog like described above will open in which you can modify the connection's settings.
The gear icon will also allow you to rename or remove existing connections.