[package]
edition = "2024"
name = "tilo-net"
version = "0.5.2"
build = false
publish = true
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "The network capability on Linux, macOS and the web: async HTTP with streaming bodies, WebSocket, WebTransport, network status, raw sockets on the desktop, and Tilo's one TLS provider and trust source."
homepage = "https://tilo.so"
readme = "supporting-crate.md"
license = "MIT"
repository = "https://code.tilo.so/tilo/tilo"
resolver = "2"
[features]
blocking = [
"http",
"reqwest/blocking",
"dep:sha2",
"dep:hex",
]
default = []
http = [
"dep:reqwest",
"reqwest/gzip",
"reqwest/brotli",
"dep:base64",
]
json = [
"http",
"dep:serde",
"dep:serde_json",
]
proxy-dev-server = [
"proxy-host",
"dep:hyper",
"dep:hyper-util",
"tokio/rt-multi-thread",
"tokio/signal",
]
proxy-host = [
"http",
"dep:http-body",
"dep:http-body-util",
"dep:futures-util",
"dep:tracing",
]
sockets = ["dep:tokio-rustls"]
system-status = [
"dep:zbus",
"dep:futures-util",
]
webtransport = [
"dep:web-transport-quinn",
"dep:web-transport-trait",
]
ws = [
"dep:tokio-websockets",
"dep:tokio-rustls",
"dep:futures-util",
]
[lib]
name = "tilo_net"
path = "src/lib.rs"
[[bin]]
name = "tilo-fetch-proxy"
path = "src/bin/tilo-fetch-proxy.rs"
required-features = ["proxy-dev-server"]
[[test]]
name = "desktop"
path = "tests/desktop.rs"
required-features = [
"http",
"json",
"ws",
"webtransport",
]
[[test]]
name = "iroh_relay_handshake"
path = "tests/iroh_relay_handshake.rs"
[[test]]
name = "iroh_trust"
path = "tests/iroh_trust.rs"
[[test]]
name = "proxy_host"
path = "tests/proxy_host.rs"
required-features = ["proxy-host"]
[dependencies.base64]
version = "0.22.1"
optional = true
[dependencies.bytes]
version = "1.11.1"
[dependencies.http]
version = "1.4"
[dependencies.serde]
version = "1.0.228"
features = ["derive"]
optional = true
[dependencies.serde_json]
version = "1.0"
optional = true
[dependencies.thiserror]
version = "2"
[dependencies.tilo-clock]
version = "=0.5.2"
[dependencies.tilo-lock]
version = "=0.5.2"
[dependencies.tilo-platform-caps]
version = "=0.5.2"
[dependencies.tokio]
version = "1.53.3"
features = [
"macros",
"sync",
]
[dependencies.url]
version = "2"
[dependencies.web-transport-trait]
version = "0.4.0"
optional = true
[dev-dependencies.flate2]
version = "1"
[dev-dependencies.futures-util]
version = "0.3"
features = ["sink"]
[dev-dependencies.rcgen]
version = "0.14"
[dev-dependencies.serde]
version = "1.0.228"
features = [
"derive",
"derive",
]
[dev-dependencies.sha2]
version = "0.11"
[dev-dependencies.tokio]
version = "1.53.3"
features = [
"io-util",
"macros",
"net",
"rt",
"rt-multi-thread",
"sync",
"test-util",
"time",
]
[dev-dependencies.tokio-websockets]
version = "0.13.3"
features = [
"client",
"getrandom",
"ring",
"rustls-bring-your-own-connector",
"server",
]
default-features = false
[dev-dependencies.web-transport-quinn]
version = "0.12.1"
features = ["ring"]
default-features = false
[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies.js-sys]
version = "=0.3.85"
[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies.send_wrapper]
version = "0.6"
features = ["futures"]
[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies.wasm-bindgen]
version = "=0.2.108"
[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies.wasm-bindgen-futures]
version = "=0.4.58"
[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies.web-sys]
version = "=0.3.85"
features = [
"AbortController",
"AbortSignal",
"BinaryType",
"CloseEvent",
"Event",
"Headers",
"Location",
"MessageEvent",
"ReadableStream",
"ReadableStreamDefaultReader",
"ReferrerPolicy",
"Request",
"RequestCredentials",
"RequestInit",
"RequestMode",
"RequestRedirect",
"Response",
"ResponseType",
"WebSocket",
"WritableStream",
"WritableStreamDefaultWriter",
]
[target.'cfg(not(target_arch = "wasm32"))'.dependencies.workspace-hack]
version = "0.1"
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies.iroh]
version = "1.0.3"
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies.iroh-relay]
version = "1.0.3"
features = ["server"]
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies.tempfile]
version = "3.27.0"
[target.'cfg(not(target_family = "wasm"))'.dependencies.futures-util]
version = "0.3"
features = ["sink"]
optional = true
[target.'cfg(not(target_family = "wasm"))'.dependencies.hex]
version = "0.4.3"
optional = true
[target.'cfg(not(target_family = "wasm"))'.dependencies.http-body]
version = "1"
optional = true
[target.'cfg(not(target_family = "wasm"))'.dependencies.http-body-util]
version = "0.1"
optional = true
[target.'cfg(not(target_family = "wasm"))'.dependencies.hyper]
version = "1"
features = [
"server",
"http1",
]
optional = true
[target.'cfg(not(target_family = "wasm"))'.dependencies.hyper-util]
version = "0.1"
features = ["tokio"]
optional = true
[target.'cfg(not(target_family = "wasm"))'.dependencies.reqwest]
version = "0.13"
features = ["rustls-no-provider"]
optional = true
default-features = false
[target.'cfg(not(target_family = "wasm"))'.dependencies.rustls]
version = "0.23"
features = [
"ring",
"std",
]
default-features = false
[target.'cfg(not(target_family = "wasm"))'.dependencies.rustls-native-certs]
version = "0.8"
[target.'cfg(not(target_family = "wasm"))'.dependencies.rustls-platform-verifier]
version = "0.7"
[target.'cfg(not(target_family = "wasm"))'.dependencies.sha2]
version = "0.11"
optional = true
[target.'cfg(not(target_family = "wasm"))'.dependencies.tokio]
version = "1.53.3"
features = [
"io-util",
"macros",
"net",
"rt",
"sync",
"time",
]
[target.'cfg(not(target_family = "wasm"))'.dependencies.tokio-rustls]
version = "0.26"
features = ["ring"]
optional = true
default-features = false
[target.'cfg(not(target_family = "wasm"))'.dependencies.tokio-websockets]
version = "0.13.3"
features = [
"client",
"getrandom",
"ring",
"rustls-bring-your-own-connector",
]
optional = true
default-features = false
[target.'cfg(not(target_family = "wasm"))'.dependencies.tracing]
version = "0.1"
optional = true
[target.'cfg(not(target_family = "wasm"))'.dependencies.web-transport-quinn]
version = "0.12.1"
features = ["ring"]
optional = true
default-features = false
[target.'cfg(target_os = "linux")'.dependencies.futures-util]
version = "0.3"
optional = true
[target.'cfg(target_os = "linux")'.dependencies.zbus]
version = "5.16"
features = [
"tokio",
"p2p",
]
optional = true
default-features = false
[lints.clippy]
allow_attributes_without_reason = "deny"
arithmetic_side_effects = "deny"
as_conversions = "allow"
as_ptr_cast_mut = "deny"
clear_with_drain = "deny"
collection_is_never_read = "deny"
debug_assert_with_mut_call = "deny"
disallowed_methods = "deny"
duration_suboptimal_units = "allow"
equatable_if_let = "deny"
exit = "deny"
expect_used = "deny"
future_not_send = "deny"
indexing_slicing = "deny"
iter_with_drain = "deny"
literal_string_with_formatting_args = "deny"
missing_errors_doc = "allow"
missing_panics_doc = "allow"
must_use_candidate = "allow"
needless_collect = "deny"
needless_pass_by_ref_mut = "deny"
non_send_fields_in_send_ty = "deny"
or_fun_call = "deny"
panic = "deny"
panic_in_result_fn = "deny"
path_buf_push_overwrite = "deny"
read_zero_byte_vec = "deny"
redundant_clone = "deny"
set_contains_or_insert = "deny"
significant_drop_in_scrutinee = "deny"
significant_drop_tightening = "deny"
string_slice = "deny"
suspicious_operation_groupings = "deny"
todo = "deny"
too_many_arguments = "deny"
trailing_empty_array = "deny"
transmute_undefined_repr = "deny"
unimplemented = "deny"
uninhabited_references = "deny"
unreachable = "deny"
unused_peekable = "deny"
unwrap_used = "deny"
while_float = "deny"
[lints.clippy.pedantic]
level = "deny"
priority = -1
[lints.rust.unexpected_cfgs]
level = "warn"
priority = 0
check-cfg = [
"cfg(tilo_no_js)",
"cfg(tilo_model_split)",
"cfg(tilo_model_guest)",
]