WIP
This commit is contained in:
@@ -1,3 +1,15 @@
|
||||
fn main() {
|
||||
println!("Hello, world!");
|
||||
use websockets::{WebSocket, WebSocketError};
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), WebSocketError> {
|
||||
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);
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user