15 releases (9 breaking)

Uses new Rust 2021

0.10.0 Nov 14, 2022
0.10.0-beta.3 Sep 5, 2022
0.9.1 Feb 25, 2022
0.9.0 Dec 20, 2021
0.2.0 Dec 29, 2020

#500 in Web programming

Download history 25/week @ 2022-08-10 113/week @ 2022-08-17 81/week @ 2022-08-24 70/week @ 2022-08-31 42/week @ 2022-09-07 54/week @ 2022-09-14 30/week @ 2022-09-21 57/week @ 2022-09-28 288/week @ 2022-10-05 26/week @ 2022-10-12 20/week @ 2022-10-19 28/week @ 2022-10-26 34/week @ 2022-11-02 190/week @ 2022-11-09 64/week @ 2022-11-16 43/week @ 2022-11-23

333 downloads per month
Used in obs-scene-monitor-changer

MIT license

280KB
6K SLoC

OBWS - The obws (obvious) remote control library for OBS

Build Status Repository Documentation Code Coverage

Remote control OBS with the obs-websocket plugin from Rust 🦀.

Usage

Add obws to your project with cargo add obws@0.10.0 or add it manually to your Cargo.toml:

[dependencies]
obws = "0.10.0"

In addition, you will need to use the latest tokio runtime to use this library as it makes heavy use of async/await and is bound to this runtime.

Example

Here we connect to a OBS instance, get some version information and log in to access the whole API and lastly print out a list of available scenes.

For more usage instructions see the docs or check out the examples.

use anyhow::Result;
use obws::Client;

#[tokio::main]
async fn main() -> Result<()> {
    // Connect to the OBS instance through obs-websocket.
    let client = Client::connect("localhost", 4455, Some("password")).await?;

    // Get and print out version information of OBS and obs-websocket.
    let version = client.general().version().await?;
    println!("{:#?}", version);

    // Get a list of available scenes and print them out.
    let scene_list = client.scenes().list().await?;
    println!("{:#?}", scene_list);

    Ok(())
}

License

This project is licensed under MIT License (or http://opensource.org/licenses/MIT).

Dependencies

~8–16MB
~320K SLoC