rust_tls_client

Crates.iorust_tls_client
lib.rsrust_tls_client
version0.1.0
sourcesrc
created_at2024-04-22 04:43:37.543834
updated_at2024-04-22 04:43:37.543834
descriptionA rust tls client based on the cffi distributions of bogdanfinn/tls-client
homepagehttps://github.com/mbc012/rust_tls_client
repositoryhttps://github.com/mbc012/rust_tls_client
max_upload_size
id1215876
size74,743
Michael (mbc012)

documentation

https://docs.rs/rust_tls_client

README

rust_tls_client

A rust tls client based on the cffi distributions of bogdanfinn/tls-client, designed to work with, and similar to the reqwest library. Automatically downloads the latest distribution (based on system) and stores in the temp dir.

  • Note: It has only been tested on Windows 64bit.

Usage/Examples

// reqwest header map
let mut hm = HeaderMap::new();
hm.insert(ACCEPT, HeaderValue::from_static("text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"));
hm.insert(USER_AGENT, HeaderValue::from_static("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36"));
hm.insert(ACCEPT_ENCODING, HeaderValue::from_static("gzip, deflate, br"));
hm.insert(ACCEPT_LANGUAGE, HeaderValue::from_static("de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7"));

// create TlsClient instance
let client = TlsClient::new(ClientIdentifier::Chrome105, false);

// make request, in similar syntax to reqwest
let req = &client.get("https://microsoft.com")
    .headers(hm)
    .send()
    .unwrap();

println!("{}", serde_json::to_string(&req).unwrap());
Commit count: 18

cargo fmt