19 lines
439 B
Rust
19 lines
439 B
Rust
use cli::parse_args;
|
|
use websockets::{WebSocket, WebSocketError};
|
|
|
|
pub(crate) mod cli;
|
|
|
|
#[tokio::main]
|
|
async fn main() -> Result<(), WebSocketError> {
|
|
parse_args();
|
|
let mut ws = WebSocket::connect("ws://localhost:8080/").await?;
|
|
|
|
ws.send_text("foo".to_string()).await?;
|
|
// ws.receive().await?;
|
|
// ws.close(None).await?;
|
|
loop {
|
|
let msg = ws.receive().await?;
|
|
println!("Received: {:?}", msg);
|
|
}
|
|
}
|