All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Payload
now implementsFrom<Vec<u8>>
Payload
now also implementsInto<BytesMut>
, which is a cheap conversion unless multiple references to the backing buffer exist
- [breaking] The MSRV is now 1.79, allowing use of
split_at_mut_unchecked
to make some unsafe code less error prone - [breaking] The minimum required version of bytes is now 1.7
- [breaking] The
Resolver
trait now uses async fn syntax - The
From<String>
implementation onPayload
now usesBytesMut
internally, improving performance in some cases - The
From<Bytes>
implementation onPayload
now usesBytesMut
internally if cheaply possible, improving performance in some cases
- Fixed an unsafe precondition violation triggered upon receiving close messages with empty reason
- Yet another docs.rs build fix
- Added support for
rustls-platform-verifier
via a feature with the same name
- Fixed the docs.rs build
- Support for
aws_lc_rs
as a SHA1 and crypto provider was added via theaws_lc_rs
feature, optionally also FIPS-compliant via thefips
feature - The new
rustls-tls12
feature will enable TLS1.2 support in rustls
- [breaking] The rustls dependency was updated to 0.23 and tokio-rustls to 0.26
- [breaking] The minimum required version of tokio-util is now 0.7.3
- A bunch of leftover unused
Encoder
implementations and the associated write buffers were removed - The
client
feature no longer depends ontokio/rt
- The
nightly
feature now enables thestdarch_x86_avx512
nightly feature only on x86_64 instead of all architectures - The documentation for
Config::frame_size
was ambiguous about whether it affected the payload size or the entire frame size, this has been clarified to be the payload size
- The
http-integration
feature and associatedupgrade_request
method were removed, it offered little to no value over manually crafting a request and bloated the dev-dependency stack unnecessarily
- [breaking] The future returned from
Resolver::resolve
is now required to beSend
. This restores backwards compatibility with 0.5.x
Payload
now implementsFrom<&'static [u8]>
andFrom<&'static str>
- The
ClientBuilder
now allows specifying a DNS resolver that implements theResolver
trait viaClientBuilder::resolver
, stored as a generic on the builder. It defaults toresolver::Gai
, which matches behavior on previous versions
- [breaking]
ClientBuilder::connect
now returns anError::UnsupportedScheme
if the URI does not set the scheme tows
orwss
- [breaking]
ClientBuilder::connect
will no longer unconditionally use the specified custom connector, instead it will always use a plain connector for thews
scheme - [breaking] The
nightly
feature now uses the newstdsimd
feature instead ofstdarch_x86_avx512
, which was removed in recent nightly compiler versions
- The
Debug
implementation ofConnector
now prints the correct name of theRustls
variant - The header buffer size in the built-in server was increased to 64, which allows clients sending larger amounts of headers to connect
- Fixed a case of UB when a message was constructed via
Message::text
with invalid UTF-8 and then converted to a&str
viaMessage::as_text
. This will now cause a panic
Message::text
now takesInto<Payload>
instead ofString
, which now implementsInto<Payload>
- Updated
http
to 1.0 andrustls
-related dependencies to those compatible withrustls
0.22 - [breaking]
ring
is now an optional dependency withrustls
and different crypto providers can be used - Optimized
simdutf8
feature flags for aarch64
- [breaking]
upgrade_request
no longer uses an explicit body type, now it only requires the body to implementDefault
- [breaking]
WebsocketStream
has been renamed toWebSocketStream
- [breaking]
Message
payloads are now exposed asPayload
and it is possible to create messages fromBytes
-backed payloads - Removed a few excess allocations in hot paths
- Fixed issues with the close sequence handling
- Fixed invalid opcode errors when intermediate control frames were received
- Update
webpki
to 0.24,webpki-roots
to 0.25 andrust-webpki
to 0.101
- Added support for NEON-accelerated frame (un)masking
- Added support for AVX512-accelerated frame (un)masking, gated behind the
nightly
feature flag and requires a nightly compiler - Limits for payload length can be applied via
{ClientBuilder, ServerBuilder}::limits
to protect against malicious peers - The websocket stream can now be configured via
{ClientBuilder, ServerBuilder}::config
. This currently only supports changing the frame payload size that outgoing messages are chunked into
- The crate now specifies and validates a MSRV of Rust 1.64
- The library now validates UTF-8 in partial continuation frames to a text message
- Several types now implement
Debug
- The performance of the decoder has been improved
- The encoder is now usually zero-copy and operates in-place when possible
- Reduced the amount of calls to
fastrand
upgrade::Error
is now publicly accessible and can thus be matched on- [breaking]
ClientBuilder
methods which perform a handshake now return a tuple of(WebsocketStream, Response)
to retrieve e.g. response headers - [breaking]
WebsocketStream
is now fully cancellation safe and implementsStream
, therefore usingWebsocketStream::next
now requires havingStreamExt
in scope - [breaking]
CloseCode
is now a wrapper around aNonZeroU16
instead of an enum. Enum variants have been moved to associated constants. This fixes possible creation of disallowed close codes by the user - [breaking] All error types are now marked as
non_exhaustive
to prevent consumer build breakage when new variants are added - [breaking] Emptied default features
- [breaking]
{ClientBuilder, ServerBuilder}::fail_fast_on_invalid_utf8
has been removed and is now always enabled because our implementation for streaming UTF-8 validation is already efficient enough, benchmarks show no gains anymore - [breaking] Some error variants have been removed and coalesced into other variants (mostly into
InvalidOpcode
).ConnectionClosed
has been entirely removed in favor of returningNone
frompoll_next
because it is more idiomatic - [breaking]
WebsocketStream::close
has been removed. TheSinkExt::close
implementation will send a default close message and properly shut down the sink. Custom close messages can be sent viaSinkExt::send
followed bySinkExt::close
- The
futures-util
dependency has been removed
- A few inconsistencies with the websocket RFC have been fixed