libwisp 0.2.0

a simple-to-use wisp rust library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use libwisp::{WispContext, WispSetServer, WispSwitchServer, WispClose};
use tokio;

#[tokio::main]
async fn main() {
    let mut ctx = WispContext::new();

    // connect to first wisp server
    WispSetServer(&mut ctx, "wss://wispserver.dev/wisp/").await;
    println!("connected to first server (wss://wispserver.dev/wisp/)");

    // switch to a second wisp server
    WispSwitchServer(&mut ctx, "wss://wispserver.dev/adblocking/").await;
    println!("switched to second server (wss://wispserver.dev/adblocking/)");

    // close connection for good practice
    WispClose(&mut ctx).await;
}