Cargo Features

tokio-websockets has no features set by default.

[dependencies]
tokio-websockets = { version = "0.7.0", features = ["client", "http-integration", "ring", "server", "simd", "native-tls", "rustls-webpki-roots", "rustls-native-roots", "nightly", "sha1_smol", "fastrand", "getrandom", "rand", "openssl"] }
client

Enables io-util, net and rt of tokio and base64 ^0.21, http, and httparse

base64:

Client

Affects tokio-websockets::client, tokio-websockets::resolver, upgrade::Response, tokio-websockets::http, tokio-websockets::upgrade

http-integration

Affects tokio-websockets::http

ring

Enables ring, ring of optional tokio-rustls ^0.25

Affects sha::digest

server

Enables base64 ^0.21, http, and httparse, io-util of tokio

Affects tokio-websockets::server, tokio-websockets::upgrade

simd

Enables simdutf8

SIMD
We enable aarch64_neon feature because it is MSRV-gated but ours is higher than 1.59

native-tls

Enables tokio-native-tls

Native TLS

rustls-webpki-roots

Enables rustls-pki-types, tokio-rustls ^0.25, and webpki-roots

rustls-pki-types:

Rustls

rustls-native-roots

Enables rustls-native-certs, rustls-pki-types, and tokio-rustls ^0.25

nightly

Enables aarch64_neon_prefetch of optional simdutf8

Features from optional dependencies

sha1_smol implicit feature

Enables sha1_smol

SHA-1 fallback when no TLS is enabled

Affects sha::digest

fastrand implicit feature

Enables fastrand

Randomness providers

getrandom implicit feature

Enables getrandom

getrandom:

A small cross-platform library for retrieving random data from system source

rand implicit feature

Enables rand

rand:

Random number generators and other randomness functionality

openssl implicit feature

Enables openssl

Users can manually tune into OpenSSL for SHA-1 when native-tls is enabled

Affects sha::digest