leyline-http 0.1.5

HTTP client that impersonates Chrome, Firefox, and Safari on the wire: TLS (JA3/JA4), HTTP/2, and HTTP/3 fingerprints
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use leyline::Session;

#[tokio::main]
async fn main() -> leyline::Result<()> {
    let url = std::env::args()
        .nth(1)
        .unwrap_or_else(|| "wss://echo.websocket.org".to_string());

    let session = Session::browser(leyline::Browser::default());
    let mut ws = session.websocket(&url).connect().await?;
    ws.send(leyline::WsMessage::Text("hello from leyline".to_owned()))
        .await?;
    if let Some(msg) = ws.recv().await? {
        println!("{msg:?}");
    }
    ws.close().await
}