[package]
name = "rquest"
version = "1.2.1"
description = "Asynchronous Rust HTTP client with TLS, JA3/JA4, and HTTP2 fingerprint spoof"
keywords = ["http", "client", "websocket", "ja3", "ja4"]
categories = ["web-programming::http-client"]
repository = "https://github.com/penumbra-x/rquest"
documentation = "https://docs.rs/rquest"
authors = ["0x676e67 <gngppz@gmail.com>"]
readme = "README.md"
license = "Apache-2.0"
edition = "2021"
rust-version = "1.80"

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
targets = ["x86_64-unknown-linux-gnu"]

[features]
default = ["webpki-roots", "charset"]

full = [
    "json",
    "stream",
    "cookies",
    "socks",
    "gzip",
    "brotli",
    "zstd",
    "deflate",
]

websocket = ["dep:async-tungstenite", "tokio-util/compat"]

charset = ["dep:encoding_rs"]

cookies = ["dep:cookie_crate", "dep:cookie_store"]

gzip = ["dep:async-compression", "async-compression?/gzip", "dep:tokio-util"]

brotli = [
    "dep:async-compression",
    "async-compression?/brotli",
    "dep:tokio-util",
]

zstd = ["dep:async-compression", "async-compression?/zstd", "dep:tokio-util"]

deflate = ["dep:async-compression", "async-compression?/zlib", "dep:tokio-util"]

json = ["dep:serde_json"]

multipart = ["dep:mime_guess"]

hickory-dns = ["dep:hickory-resolver"]

stream = ["tokio/fs", "dep:tokio-util"]

socks = ["dep:tokio-socks"]

native-roots = ["dep:rustls-native-certs"]
webpki-roots = ["dep:webpki-root-certs"]

# Optional disable internal proxy cache
internal_proxy_sys_no_cache = []

# Optional enable impersonate from str
impersonate_str = []

# Optional enable impersonate from settings
impersonate_settings = []

# Internal (PRIVATE!) features used to aid testing.
# Don't rely on these whatsoever. They may disappear at anytime.

[dependencies]
base64 = "0.22"
http = "1"
url = "2.5"
bytes = "1.0"
serde = "1.0"
serde_urlencoded = "0.7.1"
tower = { version = "0.5.0", default-features = false, features = [
    "timeout",
    "util",
] }
tower-service = "0.3"
futures-core = { version = "0.3.0", default-features = false }
futures-util = { version = "0.3.0", default-features = false }
sync_wrapper = { version = "1.0", features = ["futures"] }
antidote = { version = "1" }

# Optional deps...

## json
serde_json = { version = "1.0", optional = true }
## multipart
mime_guess = { version = "2.0", default-features = false, optional = true }

## common
encoding_rs = { version = "0.8", optional = true }
http-body = "1"
http-body-util = "0.1"
hyper2 = { version = "1", features = ["http1", "http2", "client"] }
log = "0.4"
mime = "0.3.17"
percent-encoding = "2.3"
tokio = { version = "1", default-features = false, features = [
    "net",
    "time",
    "rt",
] }
pin-project-lite = "0.2.0"
ipnet = "2.10.0"

# hyper util
socket2 = { version = "0.5", features = ["all"] }
futures-channel = { version = "0.3" }
lru = { version = "0.12", default-features = false }

# Optional deps...

## boring-tls
boring = { package = "boring2", version = "4", features = ["pq-experimental"] }
boring-sys = { package = "boring-sys2", version = "4" }
tokio-boring = { package = "tokio-boring2", version = "4" }
foreign-types = { version = "0.5.0" }
typed-builder = { version = "0.20.0" }

# boring-tls session cache
linked_hash_set = { version = "0.1" }
tower-layer = { version = "0.3" }

# cert compression
brotli = { version = "7" }
flate2 = { version = "1" }
zstd = { version = "0.13" }

# tls root certs
rustls-native-certs = { version = "0.8.0", optional = true }
webpki-root-certs = { version = "0.26.0", optional = true }

## cookies
cookie_crate = { version = "0.18", package = "cookie", optional = true }
cookie_store = { version = "0.21", optional = true }

## compression
async-compression = { version = "0.4.0", default-features = false, features = [
    "tokio",
], optional = true }
tokio-util = { version = "0.7.0", default-features = false, features = [
    "codec",
    "io",
], optional = true }

## socks
tokio-socks = { version = "0.5.2", optional = true }

## websocket
async-tungstenite = { version = "0.28.0", optional = true }

## hickory-dns
hickory-resolver = { version = "0.24", optional = true }

[target.'cfg(windows)'.dependencies]
windows-registry = "0.3.0"

[target.'cfg(target_os = "macos")'.dependencies]
system-configuration = "0.6.0"

[dev-dependencies]
hyper = { version = "1.1.0", default-features = false, features = [
    "http1",
    "http2",
    "client",
    "server",
] }
hyper-util = { version = "0.1.10", features = [
    "http1",
    "http2",
    "client",
    "client-legacy",
    "server-auto",
    "tokio",
] }
env_logger = "0.10.0"
serde = { version = "1.0", features = ["derive"] }
libflate = "2.0.0"
zstd = { version = "0.13" }
doc-comment = "0.3"
tokio = { version = "1.0", default-features = false, features = [
    "macros",
    "rt-multi-thread",
] }
futures = { version = "0.3.0", default-features = false, features = ["std"] }
tower = { version = "0.5.2", default-features = false, features = ["limit"] }
num_cpus = "1.0"
libc = "0"

[[example]]
name = "json_dynamic"
path = "examples/json_dynamic.rs"
required-features = ["json"]

[[example]]
name = "json_typed"
path = "examples/json_typed.rs"
required-features = ["json"]

[[example]]
name = "tor_socks"
path = "examples/tor_socks.rs"
required-features = ["socks"]

[[example]]
name = "form"
path = "examples/form.rs"

[[example]]
name = "simple"
path = "examples/simple.rs"

[[example]]
name = "impersonate"
path = "examples/impersonate.rs"

[[example]]
name = "hickory_dns"
path = "examples/hickory_dns.rs"
required-features = ["hickory-dns"]

[[example]]
name = "headers_order"
path = "examples/headers_order.rs"
required-features = ["cookies"]

[[example]]
name = "impersonate_skip_headers"
path = "examples/impersonate_skip_headers.rs"

[[example]]
name = "impersonate_psk"
path = "examples/impersonate_psk.rs"

[[example]]
name = "set_headers"
path = "examples/set_headers.rs"

[[example]]
name = "set_cookies"
path = "examples/set_cookies.rs"
required-features = ["cookies"]

[[example]]
name = "set_cookie_provider"
path = "examples/set_cookie_provider.rs"
required-features = ["cookies"]

[[example]]
name = "set_proxies"
path = "examples/set_proxies.rs"
required-features = ["socks", "brotli"]

[[example]]
name = "set_local_address"
path = "examples/set_local_address.rs"
required-features = ["brotli"]

[[example]]
name = "set_interface"
path = "examples/set_interface.rs"
required-features = ["brotli"]

[[example]]
name = "set_native_root_cert"
path = "examples/set_native_root_cert.rs"
required-features = ["native-roots"]

[[example]]
name = "set_webpki_root_cert"
path = "examples/set_webpki_root_cert.rs"
required-features = ["webpki-roots"]

[[example]]
name = "websocket"
path = "examples/websocket.rs"
required-features = ["websocket", "futures-util/std"]

[[test]]
name = "cookie"
path = "tests/cookie.rs"
required-features = ["cookies"]

[[test]]
name = "gzip"
path = "tests/gzip.rs"
required-features = ["gzip"]

[[test]]
name = "brotli"
path = "tests/brotli.rs"
required-features = ["brotli"]

[[test]]
name = "deflate"
path = "tests/deflate.rs"
required-features = ["deflate"]

[[test]]
name = "zstd"
path = "tests/zstd.rs"
required-features = ["zstd", "stream"]

[[test]]
name = "multipart"
path = "tests/multipart.rs"
required-features = ["multipart"]

[[example]]
name = "client"
path = "examples/client.rs"
required-features = ["full"]

[[example]]
name = "request_with_redirect"
path = "examples/request_with_redirect.rs"
required-features = ["full"]

[[example]]
name = "set_redirect"
path = "examples/set_redirect.rs"
required-features = ["full"]

[[example]]
name = "base_url"
path = "examples/base_url.rs"

[[example]]
name = "request_with_cookie_store"
path = "examples/request_with_cookie_store.rs"
required-features = ["cookies"]

[[example]]
name = "request_with_version"
path = "examples/request_with_version.rs"
required-features = ["full"]

[[example]]
name = "request_with_proxy"
path = "examples/request_with_proxy.rs"
required-features = ["full"]

[[example]]
name = "connect_via_lower_priority_tokio_runtime"
path = "examples/connect_via_lower_priority_tokio_runtime.rs"
required-features = ["full"]
