[package] name = "tokio-websockets" version = "0.10.1" edition = "2021" description = "High performance, strict, tokio-util based WebSockets implementation" categories = ["web-programming::websocket", "network-programming", "asynchronous", "concurrency"] repository = "https://github.com/Gelbpunkt/tokio-websockets/" rust-version = "1.79" license = "MIT" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] bytes = "1.7" futures-core = "0.3" futures-sink = "0.3" tokio = "1" # tokio-util 0.7.3 is the first to depend on tracing without default features, otherwise minvers break tokio-util = { version = "0.7.3", features = ["codec", "io"] } # SHA-1 fallback when no TLS is enabled sha1_smol = { version = "1.0", optional = true } # Randomness providers fastrand = { version = "2.0", default-features = false, features = ["std"], optional = true } getrandom = { version = "0.2", default-features = false, optional = true } rand = { version = "0.8", default-features = false, features = ["std", "std_rng"], optional = true } # SIMD # We enable aarch64_neon feature because it is MSRV-gated but ours is higher than 1.59 simdutf8 = { version = "0.1", default-features = false, features = ["std", "aarch64_neon"], optional = true } # Client base64 = { version = "0.22", optional = true } http = { version = "1", default-features = false, features = ["std"], optional = true } httparse = { version = "1.6", optional = true } # Native TLS tokio-native-tls = { version = "0.3", optional = true } # Rustls aws-lc-rs = { version = "1", default-features = false, features = ["aws-lc-sys"], optional = true } ring = { version = "0.17", default-features = false, optional = true } rustls-native-certs = { version = "0.8", default-features = false, optional = true } rustls-pki-types = { version = "1", optional = true } rustls-platform-verifier = { version = "0.3.1", optional = true } tokio-rustls = { version = "0.26", default-features = false, optional = true } webpki-roots = { version = "0.26", default-features = false, optional = true } # Users can manually tune into OpenSSL for SHA-1 when native-tls is enabled openssl = { version = "0.10", default-features = false, optional = true } [features] client = ["dep:base64", "dep:http", "dep:httparse", "tokio/net", "tokio/io-util"] aws_lc_rs = ["dep:aws-lc-rs", "tokio-rustls?/aws_lc_rs"] # Underscores for consistency with other rustls crates aws-lc-rs = ["aws_lc_rs"] # Alias because Cargo features commonly use `-` fips = ["aws_lc_rs", "aws-lc-rs?/fips", "tokio-rustls?/fips"] ring = ["dep:ring", "tokio-rustls?/ring"] server = ["dep:base64", "dep:http", "dep:httparse", "tokio/io-util"] simd = ["dep:simdutf8"] native-tls = ["dep:tokio-native-tls"] rustls-webpki-roots = ["dep:rustls-pki-types", "dep:tokio-rustls", "dep:webpki-roots"] rustls-native-roots = ["dep:rustls-pki-types", "dep:tokio-rustls", "dep:rustls-native-certs"] rustls-platform-verifier = ["dep:rustls-pki-types", "dep:tokio-rustls", "dep:rustls-platform-verifier"] rustls-bring-your-own-connector = ["dep:rustls-pki-types", "dep:tokio-rustls"] rustls-tls12 = ["tokio-rustls?/tls12"] nightly = ["simdutf8?/aarch64_neon_prefetch"] [dev-dependencies] futures-util = { version = "0.3.14", default-features = false, features = ["sink"] } rustls-pemfile = "2" rustls-pki-types = "1" tokio = { version = "1", default-features = false, features = ["net", "macros", "rt-multi-thread"] } tokio-rustls = "0.26" [[example]] name = "autobahn_client" required-features = ["client"] [[example]] name = "autobahn_server" required-features = ["server"] [[example]] name = "client" required-features = ["client"] [[example]] name = "echo_server" required-features = ["server"] [[example]] name = "native_tls_self_signed_client" required-features = ["client", "native-tls"] [[example]] name = "rustls_server" required-features = ["server"] [[example]] name = "server" required-features = ["server"] [[example]] name = "utf8_benchmark_client" required-features = ["client"] [[example]] name = "utf8_benchmark_server" required-features = ["server"] [package.metadata.docs.rs] # aws_lc_rs' fips mode can't be built in docs.rs features = ["client", "aws_lc_rs", "ring", "fastrand", "getrandom", "rand", "server", "simd", "native-tls", "rustls-native-roots", "rustls-webpki-roots", "rustls-platform-verifier", "rustls-tls12", "nightly"] rustdoc-args = ["--cfg", "docsrs"] [profile.release] codegen-units = 1 debug = false incremental = false lto = true opt-level = 3