[workspace]
members = [
    ".",
    "mitmproxy-rs",
    "mitmproxy-linux",
    "mitmproxy-linux-ebpf",
    "mitmproxy-linux-ebpf-common",
    "mitmproxy-macos/certificate-truster",
    "mitmproxy-windows/redirector",
    "wireguard-test-client",
]
default-members = [
    ".",
    "mitmproxy-rs",
    "mitmproxy-linux",
    "mitmproxy-linux-ebpf-common",
    "mitmproxy-macos/certificate-truster",
    "mitmproxy-windows/redirector",
    "wireguard-test-client",
]

[workspace.package]
authors = [
    "Fabio Valentini <decathorpe@gmail.com>",
    "Maximilian Hils <cargo@maximilianhils.com>",
]
version = "0.11.2"
publish = false
repository = "https://github.com/mitmproxy/mitmproxy-rs"
edition = "2021"
rust-version = "1.80"  # MSRV

[workspace.dependencies]
aya = { version = "0.13.0", default-features = false }
aya-ebpf = { version = "0.1.1", default-features = false }
aya-log = { version = "0.2.1", default-features = false }
aya-log-ebpf = { version = "0.1.1", default-features = false }
tun = { version = "0.7.10" }

[workspace.lints.clippy]
large_futures = "deny"

[package]
name = "mitmproxy"
license = "MIT"
authors.workspace = true
version.workspace = true
repository.workspace = true
edition.workspace = true
rust-version.workspace = true
publish.workspace = true

[dependencies]
anyhow = { version = "1.0.93", features = ["backtrace"] }
log = "0.4.22"
once_cell = "1"
pretty-hex = "0.4.1"
smoltcp = "0.12"
tokio = { version = "1.41.1", features = ["macros", "net", "rt-multi-thread", "sync", "time", "io-util", "process"] }
boringtun = { version = "0.6", default-features = false }
console-subscriber = { version = "0.4.1", optional = true }
image = { version = "0.25.5", default-features = false, features = ["png", "tiff"] }
prost = "0.13.3"
tokio-util = { version = "0.7.12", features = ["codec"] }
futures-util = { version = "0.3.31", features = ["sink"] }
lru_time_cache = "0.11.11"
internet-packet = { version = "0.2.3", features = ["smoltcp"] }
data-encoding = "2.4.0"
hickory-resolver = "0.24.1"
socket2 = "0.5.8"

[patch.crates-io]
# tokio = { path = "../tokio/tokio" }
boringtun = { git = 'https://github.com/cloudflare/boringtun', rev = 'e3252d9c4f4c8fc628995330f45369effd4660a1' }

[target.'cfg(windows)'.dependencies.windows]
version = "0.58.0"
features = [
    "Win32_Foundation",
    "Win32_Graphics_Dwm",
    "Win32_Graphics_Gdi",
    "Win32_Networking_WinSock",
    "Win32_NetworkManagement_IpHelper",
    "Win32_Storage_FileSystem",
    "Win32_System_LibraryLoader",
    "Win32_System_ProcessStatus",
    "Win32_System_Threading",
    "Win32_UI_Shell",
    "Win32_UI_WindowsAndMessaging",
]

[target.'cfg(target_os = "macos")'.dependencies]
security-framework = "3.0.1"
nix = { version = "0.29.0", default-features = false, features = ["fs"] }
core-graphics = "0.24"
core-foundation = "0.10"
cocoa = "0.26"
objc = "0.2"
sysinfo = "0.33.0"

[target.'cfg(target_os = "linux")'.dependencies]
tun = { workspace = true, features = ["async"] }
tempfile = "3.14.0"
sysinfo = "0.33.0"

[dev-dependencies]
env_logger = "0.11"
rand = "0.8"
criterion = "0.5.1"
hickory-server = "0.24.1"


[[bench]]
name = "process"
harness = false

[profile.release]
codegen-units = 1
lto = true
opt-level = 3

[features]
tracing = ["console-subscriber"]
