PackageTrack
Sign in Get early access

tokio-websockets

High performance, strict, tokio-util based WebSockets implementation

0.13.3 12M downloads/mo #2830 most downloaded on crates.io Gelbpunkt/tokio-websockets

What this package is like to depend on

Last release 1 months ago

25 Jun 2026

Ships fairly regularly

a new release about every 2 months

Most releases are documented

notes for 25 of 31 stable releases

1 version withdrawn

withdrawn after publishing

4 years old

32 releases · first in 2022

6 releases in the last 12 months

see the full history below

Release timeline

32 releases · Dec 2022 to Jun 2026
2023 2024 2025 2026
Release Pre-release Withdrawn

Releases

latest 32
  1. 0.13.3 25 Jun 2026
    Release notes

    Changed

    • rustls-platform-verifier was upgraded to 0.7
    Open source →
  2. 0.13.2 17 Mar 2026
    Release notes

    Added

    • On loongarch64, frame (un)masking can now also make use of LSX alongside the existing LASX support

    Changed

    • getrandom was upgraded to 0.4, rand was upgraded to 0.10

    Fixed

    • Compilation with the nightly feature enabled now works on s390x with the latest Rust nightlies again
    Open source →
  3. 0.13.1 28 Dec 2025
    Release notes

    Added

    • The new WebSocketStream::into_inner method discards the WebSocket stream and provides you with the raw underlying I/O
    • It is now possible to add custom headers to the built-in server's Switching Protocols response via ServerBuilder::add_header

    Fixed

    • Compilation with the nightly feature enabled on s390x now works with the latest nightlies again
    • Fixed a case of UB in the ARM NEON intrinsic code uncovered by Miri

    Other

    • CI now test builds all feature combinations on architectures supported by the SIMD code (aarch64, loongarch64, ppc64le, s390x, x86_64)
    • Further, on aarch64, ppc64le, s390x and x86_64 we now also run the tests with Miri
    Open source →
  4. 0.13.0 07 Oct 2025
    Release notes

    Added

    • With the nightly feature enabled and no random number generator enabled, std::random will now be used

    Changed

    • [breaking] The default rustls crypto provider is now installed implicitly, which in turn results in TlsConnector::now now panicking instead of returning the now-removed NoCryptoProviderConfigured error variant
    • [breaking] The MSRV is now 1.89, which means AVX512 support is now available without the nightly feature
    Open source →
  5. 0.12.3 28 Sep 2025
    Release notes

    Fixed

    • The docs build should be fixed by this release
    Open source →
  6. 0.12.2 28 Sep 2025
    Release notes

    Fixed

    • The minimum version requirement for fastrand was corrected to 2.2.0 to match reality
    Open source →
  7. 0.12.1 21 Aug 2025
    Release notes

    Fixed

    • Fixed an out-of-bounds access when sending a large number of messages at once
    Open source →
  8. 0.12.0 10 Jul 2025
    Release notes

    Added

    • With the nightly feature enabled, SIMD-accelerated masking is now supported on s390x and loongarch64

    Changed

    • webpki-roots was upgraded to 1.x
    • rustls-platform-verifier was upgraded to 0.6
    • Multiple pending messages are now written in a single vectored write, improving performance when using SinkExt::feed
    • [breaking] The rustls-related features now require configuring a global crypto provider for rustls

    Fixed

    • After writing the WebSocket upgrade request, the connection was not flushed, so in some cases with buffering, the connection would be stuck trying to read an upgrade response

    Removed

    • [breaking] The simd feature flag was removed - it had no effect since 0.11.1, SIMD support is now detected at runtime
    Open source →
  9. 0.11.4 18 Apr 2025
    Release notes

    Fixed

    • Fixed an issue where poll_next would not attempt to flush to stream when there is data to be sent. This is achieved by storing and then reusing the writer task's waker in poll_next.
    Open source →
  10. 0.11.3 17 Feb 2025
    Release notes

    Fixed

    • In cases where the underlying I/O was failed but data remained to be sent, a call to poll_close the WebSocket stream would block indefinitely, this is now properly handled by returning None from poll_next after I/O errors
    Open source →
  11. 0.11.2 09 Feb 2025
    Release notes

    Changed

    • rand was updated to 0.9
    • Reduced the amount of unsafe code

    Fixed

    • The Host header no longer unconditionally includes a port anymore, which is more in line with the RFC and fixes interacting with some webservers
    Open source →
  12. 0.11.1 26 Jan 2025
    Release notes

    Changed

    • The size of several structs has been slightly decreased, reducing memory usage
    • The SIMD algorithms have been improved and support for them is now detected at runtime. The simd feature flag is deprecated
    • getrandom was updated to 0.3

    Fixed

    • Fixed an issue where a pending poll_flush call by a writer would stall infinitely if poll_next was called at the same time (see #92)
    Open source →
  13. 0.11.0 03 Jan 2025
    Release notes

    Added

    • The SIMD masking code now supports AltiVec on PowerPC targets (nightly only)
    • WebSocketStream::{get_ref, get_mut} allow access to the underlying I/O
    • client::DISALLOWED_HEADERS is a list of headers that may not be added via ClientBuilder::add_header
    • CloseCode::is_reserved returns whether the close code is reserved (i.e. may not be sent over the wire)

    Changed

    • [breaking] ServerBuilder::accept now returns the client's HTTP request alongside the websocket stream in a tuple
    • [breaking] ClientBuilder::add_header now returns a Result and errors when adding a disallowed header
    • [breaking] Message::close will now panic when the close code is reserved or the reason exceeds 123 bytes
    • [breaking] Message::{ping, pong} will now panic when the payload exceeds 125 bytes
    • rustls-platform-verifier was updated to 0.5
    • The SIMD masking code is now more efficient

    Fixed

    • Fixed compilation with SIMD on 32-bit x86 targets
    • 32-bit ARM NEON is unstable in rustc and now correctly gated behind the nightly feature
    Open source →
  14. 0.10.1 13 Sep 2024
    Release notes

    Added

    • The new rustls-bring-your-own-connector feature allows for creating a Connector::Rustls instance without pulling in any other certificate roots
    • The sink flush threshold is now configurable via Config::flush_threshold

    Changed

    • Config::frame_size now panics when the frame size is set to 0
    • Reduced the number of allocations which was caused by a misunderstanding of BytesMut::reserve internals, improving throughput by up to 30%
    • The number of pending bytes to be written is no longer calculated in a potentially expensive loop in poll_ready, but rather tracked as messages are queued

    Fixed

    • Fixed a case of possible UB in the UTF-8 validator discovered by the new fuzzer (@finnbear)
    • The UTF-8 validator now uses the faster validation for partial codepoints as intended, earlier this was only the case if the number of bytes available matched the number expected
    Open source →
  15. 0.10.0 04 Sep 2024
    Release notes

    Added

    • Error::NoNativeRootCertificatesFound was added and is returned in TlsConnector::new if no native root certificates were found and the rustls-webpki-roots feature is not enabled

    Changed

    • If no crypto provider is specified via crate features, tokio-websockets will now try to use the installed default provider in rustls
    • TlsConnector::new is now always available
    • [breaking] Error::NoTlsConnectorConfigured was removed and replaced by Error::NoCryptoProviderConfigured
    • rustls-native-certs was updated to 0.8

    Fixed

    • Fixed an issue where connecting to an IPv6 address would fail
    • Specify the actual minimum version required of rustls-platform-verifier
    Open source →
  16. 0.9.0 04 Aug 2024
    Release notes

    Added

    • Payload now implements From<Vec<u8>>
    • Payload now also implements Into<BytesMut>, which is a cheap conversion unless multiple references to the backing buffer exist

    Changed

    • [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 on Payload now uses BytesMut internally, improving performance in some cases
    • The From<Bytes> implementation on Payload now uses BytesMut internally if cheaply possible, improving performance in some cases
    Open source →
  17. 0.8.3 24 May 2024
    Release notes

    Fixed

    • Fixed an unsafe precondition violation triggered upon receiving close messages with empty reason
    Open source →
  18. 0.8.2 16 Apr 2024
    Release notes

    Fixed

    • Yet another docs.rs build fix
    Open source →
  19. 0.8.1 16 Apr 2024
    Release notes

    Added

    • Added support for rustls-platform-verifier via a feature with the same name

    Fixed

    • Fixed the docs.rs build
    Open source →
  20. 0.8.0 15 Apr 2024
    Release notes

    Added

    • Support for aws_lc_rs as a SHA1 and crypto provider was added via the aws_lc_rs feature, optionally also FIPS-compliant via the fips feature
    • The new rustls-tls12 feature will enable TLS1.2 support in rustls

    Changed

    • [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 on tokio/rt

    Fixed

    • The nightly feature now enables the stdarch_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

    Removed

    • The http-integration feature and associated upgrade_request method were removed, it offered little to no value over manually crafting a request and bloated the dev-dependency stack unnecessarily
    Open source →
  21. 0.7.0 27 Feb 2024
    Release notes

    Changed

    • [breaking] The future returned from Resolver::resolve is now required to be Send. This restores backwards compatibility with 0.5.x
    Open source →
  22. 0.6.0 27 Feb 2024
    Release notes

    Added

    • Payload now implements From<&'static [u8]> and From<&'static str>
    • The ClientBuilder now allows specifying a DNS resolver that implements the Resolver trait via ClientBuilder::resolver, stored as a generic on the builder. It defaults to resolver::Gai, which matches behavior on previous versions

    Changed

    • [breaking] ClientBuilder::connect now returns an Error::UnsupportedScheme if the URI does not set the scheme to ws or wss
    • [breaking] ClientBuilder::connect will no longer unconditionally use the specified custom connector, instead it will always use a plain connector for the ws scheme
    • [breaking] The nightly feature now uses the new stdsimd feature instead of stdarch_x86_avx512, which was removed in recent nightly compiler versions

    Fixed

    • The Debug implementation of Connector now prints the correct name of the Rustls 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 via Message::as_text. This will now cause a panic
    Open source →
  23. 0.5.1 29 Dec 2023 withdrawn
    Release notes

    Changed

    • Message::text now takes Into<Payload> instead of String, which now implements Into<Payload>
    Open source →
  24. 0.5.0 11 Dec 2023
    Release notes

    Dependencies

    • Updated http to 1.0 and rustls-related dependencies to those compatible with rustls 0.22
    • [breaking] ring is now an optional dependency with rustls and different crypto providers can be used
    • Optimized simdutf8 feature flags for aarch64

    Changed

    • [breaking] upgrade_request no longer uses an explicit body type, now it only requires the body to implement Default
    • [breaking] WebsocketStream has been renamed to WebSocketStream
    • [breaking] Message payloads are now exposed as Payload and it is possible to create messages from Bytes-backed payloads
    • Removed a few excess allocations in hot paths

    Fixed

    • Fixed issues with the close sequence handling
    Open source →
  25. 0.4.1 23 Nov 2023
    Release notes

    Fixed

    • Fixed invalid opcode errors when intermediate control frames were received
    Open source →
  26. 0.4.0 10 Sep 2023
    Release notes

    Dependencies

    • Update webpki to 0.24, webpki-roots to 0.25 and rust-webpki to 0.101

    Added

    • 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

    Changed

    • 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 implements Stream, therefore using WebsocketStream::next now requires having StreamExt in scope
    • [breaking] CloseCode is now a wrapper around a NonZeroU16 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

    Removed

    • [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 returning None from poll_next because it is more idiomatic
    • [breaking] WebsocketStream::close has been removed. The SinkExt::close implementation will send a default close message and properly shut down the sink. Custom close messages can be sent via SinkExt::send followed by SinkExt::close
    • The futures-util dependency has been removed

    Fixed

    • A few inconsistencies with the websocket RFC have been fixed
    Open source →
  27. 0.3.3 16 Jun 2023

    Nothing published for this version

  28. 0.3.2 11 May 2023

    Nothing published for this version

  29. 0.3.1 11 May 2023

    Nothing published for this version

  30. 0.3.0 23 Apr 2023

    Nothing published for this version

  31. 0.2.0 06 Dec 2022

    Nothing published for this version

  32. 0.1.0 06 Dec 2022

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive