mirror of https://github.com/dnaka91/obws
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
504 B
Rust
25 lines
504 B
Rust
use std::env;
|
|
|
|
use anyhow::Result;
|
|
use futures_util::{pin_mut, StreamExt};
|
|
use obws::Client;
|
|
|
|
#[tokio::main]
|
|
async fn main() -> Result<()> {
|
|
dotenvy::dotenv().ok();
|
|
|
|
env::set_var("RUST_LOG", "obws=debug");
|
|
tracing_subscriber::fmt::init();
|
|
|
|
let client = Client::connect("localhost", 4455, env::var("OBS_PASSWORD").ok()).await?;
|
|
|
|
let events = client.events()?;
|
|
pin_mut!(events);
|
|
|
|
while let Some(event) = events.next().await {
|
|
println!("{event:#?}");
|
|
}
|
|
|
|
Ok(())
|
|
}
|