first commit

This commit is contained in:
Beyhan Oğur
2026-04-26 22:29:38 +03:00
commit 427856cd3a
176 changed files with 27613 additions and 0 deletions

30
examples/wscat.rs Normal file
View File

@@ -0,0 +1,30 @@
use clap::Parser;
use futures::StreamExt;
use tokio_tungstenite::{connect_async, tungstenite::Message};
use bifrost::error::ApiResult;
#[derive(Parser, Debug)]
struct Args {
/// Url to websocket (<ws://example.org:1234/>)
url: String,
}
#[tokio::main]
async fn main() -> ApiResult<()> {
let args = Args::parse();
let (mut socket, _) = connect_async(args.url).await?;
loop {
let Some(pkt) = socket.next().await else {
break;
};
let Message::Text(txt) = pkt? else { break };
println!("{txt}");
}
Ok(())
}