Cargo Features

[dependencies]
static-web-server = { version = "2.33.1", default-features = false, features = ["all", "http2", "compression", "compression-brotli", "compression-deflate", "compression-gzip", "compression-zstd", "directory-listing", "basic-auth", "fallback-page", "experimental"] }
default all? = basic-auth, compression, directory-listing, fallback-page, http2

All features enabled by default

all = default, experimental

Include all features (used when building SWS binaries)

http2 default = rustls-pemfile, tokio-rustls

HTTP2

Affects static-web-server::https_redirect, static-web-server::tls, cli::General.http2, cli::General.http2_tls_cert, cli::General.http2_tls_key, cli::General.https_redirect, cli::General.https_redirect_host, cli::General.https_redirect_from_port, cli::General.https_redirect_from_hosts, file::General.http2, file::General.http2_tls_cert, file::General.http2_tls_key, file::General.https_redirect, file::General.https_redirect_host, file::General.https_redirect_from_port, file::General.https_redirect_from_hosts

compression default = compression-brotli, compression-deflate, compression-gzip, compression-zstd

Compression

Affects compression::gzip, compression::deflate, compression::brotli, compression::zstd, handler::RequestHandlerOpts.compression_level, static-web-server::compression, static-web-server::compression_static, cli::General.compression, cli::General.compression_level, cli::General.compression_static, file::CompressionLevel, file::General.compression, file::General.compression_level, file::General.compression_static

compression-brotli compression

Enables async-compression

Affects compression::brotli, handler::RequestHandlerOpts.compression_level, static-web-server::compression, static-web-server::compression_static, cli::General.compression, cli::General.compression_level, cli::General.compression_static, file::CompressionLevel, file::General.compression, file::General.compression_level, file::General.compression_static

compression-deflate compression

Enables async-compression

Affects compression::deflate, handler::RequestHandlerOpts.compression_level, static-web-server::compression, static-web-server::compression_static, cli::General.compression, cli::General.compression_level, cli::General.compression_static, file::CompressionLevel, file::General.compression, file::General.compression_level, file::General.compression_static

compression-gzip compression

Enables async-compression

Affects compression::gzip, handler::RequestHandlerOpts.compression_level, static-web-server::compression, static-web-server::compression_static, cli::General.compression, cli::General.compression_level, cli::General.compression_static, file::CompressionLevel, file::General.compression, file::General.compression_level, file::General.compression_static

compression-zstd compression

Enables async-compression

Affects compression::zstd, handler::RequestHandlerOpts.compression_level, static-web-server::compression, static-web-server::compression_static, cli::General.compression, cli::General.compression_level, cli::General.compression_static, file::CompressionLevel, file::General.compression, file::General.compression_level, file::General.compression_static

directory-listing default = chrono, maud

Directory listing

Affects handler::RequestHandlerOpts.dir_listing, handler::RequestHandlerOpts.dir_listing_order, handler::RequestHandlerOpts.dir_listing_format, static-web-server::directory_listing, cli::General.directory_listing, cli::General.directory_listing_order, cli::General.directory_listing_format, file::General.directory_listing, file::General.directory_listing_order, file::General.directory_listing_format, static_files::HandleOpts.dir_listing, static_files::HandleOpts.dir_listing_order, static_files::HandleOpts.dir_listing_format

basic-auth default = bcrypt

Basic HTTP Authorization

Affects handler::RequestHandlerOpts.basic_auth, static-web-server::basic_auth, cli::General.basic_auth, file::General.basic_auth

fallback-page default

Fallback Page

Affects handler::RequestHandlerOpts.page_fallback, static-web-server::fallback_page, cli::General.page_fallback, file::General.page_fallback

experimental all? = compact_str, mini-moka, prometheus, tokio-metrics-collector

Experimental features (requires: RUSTFLAGS="--cfg tokio_unstable") --experimental-metrics

Affects handler::RequestHandlerOpts.memory_cache, handler::RequestHandlerOpts.experimental_metrics, cli::General.experimental_metrics, file::MemoryCache, file::Advanced.memory_cache, file::General.experimental_metrics, file::General.memory_cache, settings::Advanced.memory_cache, static_files::HandleOpts.memory_cache

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

async-compression compression-brotli? compression-deflate? compression-gzip? compression-zstd?
bcrypt basic-auth
chrono directory-listing
compact_str experimental?
maud directory-listing
mini-moka experimental?
rustls-pemfile http2
tokio-rustls http2
prometheus unix experimental?
tokio-metrics-collector unix experimental?