kode-bridge 0.1.2

Cross-platform Rust library for sending HTTP requests over IPC channels (Unix sockets, planned Windows named pipes).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use dotenv::dotenv;
use kode_bridge::IpcHttpClient;
use kode_bridge::errors::AnyError;

#[tokio::main]
async fn main() -> Result<(), AnyError> {
    dotenv().ok();

    let ipc_path = env::var("CUSTOM_SOCK")?;
    let client = IpcHttpClient::new(&ipc_path);
    let response = client.request("GET", "/proxies", None).await?;
    println!("{:?}", response);
    println!("{}", response.json()?);
    Ok(())
}