tungstenite
Lightweight stream-based WebSocket implementation
0.30.0
279M downloads/mo
#382 most downloaded on crates.io
snapview/tungstenite-rs
What this package is like to depend on
Last release 1 months ago
11 Jul 2026
Ships on a steady schedule
a new release about every 3 months
Some releases are documented
notes for 25 of 50 stable releases
Nothing withdrawn
no release was ever pulled
9 years old
50 releases · first in 2017
3 releases in the last 12 months
see the full history below
Release timeline
50 releases · Mar 2017 to Jul 2026Releases
latest 50-
0.30.011 Jul 2026Release notes
Open source →- Reject non-compliant clients (incorrect
Sec-WebSocket-Keylength/format) on the server side. - Update
randandshadependencies and raise MSRV to 1.85.
- Reject non-compliant clients (incorrect
-
0.29.017 Mar 2026Release notes
Open source →- Update MSRV to
1.71due tosyn(the dependency ofthiserror) requiring it. - Allow users to send headers with non-visible ASCII values (as long as they constitute a correct
HeaderValue).
- Update MSRV to
-
0.28.024 Sep 2025Release notes
Open source →- Reduce
Errorsize 136 -> 32 by boxing internals ofError::Http,Error::WriteBufferFull,ProtocolError::InvalidHeader,TlsError::Native,TlsError::Rustls. - Dependency update (
socketto0.6.0). - Add
into_inner()to theWebSocket, so that the user can extract the underlying stream. - Address the edge-case for the WebSocket request generation when
tungsteniteis built with-Zfmt-debug=none.
- Reduce
-
0.27.013 Jun 2025Release notes
Open source →- Fix large message read performance by enforcing max
read_buffer_sizeread chunks. - Make
Hashimplementation consistent forUtf8Bytespayloads.
- Fix large message read performance by enforcing max
-
0.26.218 Feb 2025Release notes
Open source →- Add
WebSocketConfig::read_buffer_sizedocs explaining performance/memory tradeoff. - Implement traits and add helper methods for the UTF8 payloads making them comparable and more ergonomic.
- Add
-
0.26.119 Dec 2024Release notes
Open source →- Fix/revert unsoundness that could lead to UB with dodgy
Readstream implementations.
- Fix/revert unsoundness that could lead to UB with dodgy
-
0.26.017 Dec 2024Release notes
Open source →- Simplify
Messageto useBytespayload directly with simplerUtf8Bytesfor text. - Change
CloseFrameto useUtf8Bytesforreason. - Re-export
Bytes.
- Simplify
-
0.25.015 Dec 2024Release notes
Open source →- New
Payloadtype forMessagethat allows sending messages with a payload that can be cheaply cloned (Bytes). Long standing issue solved! - Add
WebSocketConfig::read_buffer_sizedefault 128 KiB. This improves high load read performance. Note: This default increases memory usage compared to previous versions particularly for users expecting a high number of connections. Configure 4-8 KiB to get a similar memory usage to 0.24. - Make
WebSocketConfignon-exhaustive & add builder style construction fns. - Remove deprecated
WebSocketConfig::max_send_queue. - Trim spaces on
Sec-WebSocket-Protocolheader. - Eliminate data copies when reading complete messages & optimise read buffer. Improves performance.
- Update
thiserrorto2.
- New
-
0.24.027 Aug 2024Release notes
Open source →- Raised MSRV to 1.63 to match
tokio-tungstenite. - Connecting to WSS URL without TLS features specified results in a better error.
- Handshake will now flush after completion to be safe (works better with buffered streams).
- Raised MSRV to 1.63 to match
-
0.23.002 Jun 2024 -
0.22.001 Jun 2024Release notes
Open source →- Make
urloptional. - Add a builder for convenient headers and subprotocols construction.
- Update
rustlsdependency.
- Make
-
0.21.007 Dec 2023Release notes
Open source →- Fix read-predominant auto pong responses not flushing when hitting WouldBlock errors.
- Improve
FrameHeader::formatwrite correctness. - Update
rustlsto0.22. - Update
webpki-rootsto0.26. - Update
rustls-native-certsto0.7. - Update
httpto1.0.0.
-
0.20.123 Sep 2023 -
0.20.022 Jul 2023Release notes
Open source →- Remove many implicit flushing behaviours. In general reading and writing messages will no
longer flush until calling
flush. An exception is automatic responses (e.g. pongs) which will continue to be written and flushed when reading and writing. This allows writing a batch of messages and flushing once, improving performance. - Add
WebSocket::read,write,send,flush. Deprecateread_message,write_message,write_pending. - Add
FrameSocket::read,write,send,flush. Removeread_frame,write_frame,write_pending. Note: Previous use ofwrite_framemay be replaced withsend. - Add
WebSocketContext::read,write,flush. Removeread_message,write_message,write_pending. Note: Previous use ofwrite_messagemay be replaced withwrite+flush. - Remove
send_queue, replaced with using the frame write buffer to achieve similar results.- Add
WebSocketConfig::max_write_buffer_size. Deprecatemax_send_queue. - Add
Error::WriteBufferFull. RemoveError::SendQueueFull. Note:WriteBufferFullreturns the message that could not be written as aMessage::Frame.
- Add
- Add ability to buffer multiple writes before writing to the underlying stream, controlled by
WebSocketConfig::write_buffer_size(default 128 KiB). Improves batch message write performance. - Panic on receiving invalid
WebSocketConfig.
- Remove many implicit flushing behaviours. In general reading and writing messages will no
longer flush until calling
-
0.19.012 Apr 2023 -
0.18.028 Nov 2022Release notes
Open source →- Make handshake dependencies optional with a new
handshakefeature (now a default one!). - Return HTTP error responses (their HTTP body) upon non 101 status codes.
- Make handshake dependencies optional with a new
-
0.17.313 Jul 2022Release notes
Open source →- Respect the case-sentitivity of the "Origin" header to keep compatibility with the older servers that use case-sensitive comparison.
-
0.17.221 Feb 2022Release notes
Open source →- Fix panic when invalid manually constructed
http::Requestis passed totungstenite. - Downgrade the MSRV to
1.56due to some other crates that rely on us not being quite ready for1.58.
- Fix panic when invalid manually constructed
-
0.17.116 Feb 2022 -
0.17.014 Feb 2022Release notes
Open source →- Update of dependencies (primarily
sha1). - Add support of the fragmented messages (allow the user to send the frames without composing the full message).
- Overhaul of the client's request generation process. Now the users are able to pass the constructed
http::Request"as is" totungstenite-rs, letting the library to check the correctness of the request and specifying their own headers (including its own key if necessary). No changes for those ones who used the client in a normal way by connecting using a URL/URI (most common use-case).
- Update of dependencies (primarily
-
0.16.003 Nov 2021Release notes
Open source →- Update of dependencies (primarily
rustls,webpki-roots,rustls-native-certs). - When the close frame is received, the reply that is automatically sent to the initiator has the same code (so we just echo the frame back). Previously a new close frame was created (i.e. the close code / reason was always the same regardless of what code / reason specified by the initiator). Now it’s more symmetrical and arguably more intuitive behavior (see #246 for more context).
- The internal
ReadBufferimplementation uses heap instead of stack to store the buffer. This should solve issues with possible stack overflows in some scenarios (see #241 for more context).
- Update of dependencies (primarily
-
0.15.012 Aug 2021Release notes
Open source →- Allow selecting the method of loading root certificates if
rustlsis used as TLS implementation.- Two new feature flags
rustls-tls-native-rootsandrustls-tls-webpki-rootshave been added that activate the respective method to load certificates. - The
rustls-tlsflag was removed to raise awareness of this change. Otherwise, compilation would have continue to work and potential errors (due to different or missing certificates) only occurred at runtime. - The new feature flags are additive. If both are enabled, both methods will be used to add certificates to the TLS configuration.
- Two new feature flags
- Allow specifying a connector (for more fine-grained configuration of the TLS).
- Allow selecting the method of loading root certificates if
-
0.14.009 Jul 2021Release notes
Open source →- Use
rustls-native-certsinstead ofwebpki-rootwhenrustls-tlsfeature is enabled. - Don't use
native-tlsas a default feature (see #202 for more details). - New fast and safe implementation of the reading buffer (replacement for the
input_buffer). - Remove some errors from the
Errorenum that can't be triggered anymore with the new buffer implementation.
- Use
-
0.13.008 Feb 2021Release notes
Open source →- Add
CapacityError,UrlError, andProtocolErrortypes to represent the different types of capacity, URL, and protocol errors respectively. - Modify variants
Error::Capacity,Error::Url, andError::Protocolto hold the above errors types instead of string error messages. - Add
handshake::derive_accept_keyto facilitate external handshakes. - Add support for
rustlsas TLS backend. The previoustlsfeature flag is now removed in favor ofnative-tlsandrustls-tls, which allows to pick the TLS backend. The error API surface had to be changed to support the new error types coming from rustls related crates.
- Add
-
0.12.008 Jan 2021Release notes
Open source →- Add facilities to allow clients to follow HTTP 3XX redirects.
- Allow accepting unmasked clients on the server side to be compatible with some legacy / invalid clients.
- Update of dependencies and documentation fixes.
-
0.11.107 Aug 2020Nothing published for this version
-
0.11.012 Jun 2020Nothing published for this version
-
0.10.102 Feb 2020Nothing published for this version
-
0.10.031 Jan 2020Nothing published for this version
-
0.9.215 Nov 2019Nothing published for this version
-
0.9.108 Aug 2019Nothing published for this version
-
0.9.006 Aug 2019Nothing published for this version
-
0.8.117 May 2019Nothing published for this version
-
0.8.015 May 2019Nothing published for this version
-
0.7.007 May 2019Nothing published for this version
-
0.6.102 Nov 2018Nothing published for this version
-
0.6.018 Jul 2018Nothing published for this version
-
0.5.402 Jul 2018Nothing published for this version
-
0.5.315 Jan 2018Nothing published for this version
-
0.5.227 Dec 2017Nothing published for this version
-
0.5.112 Dec 2017Nothing published for this version
-
0.5.009 Oct 2017Nothing published for this version
-
0.4.007 Aug 2017Nothing published for this version
-
0.2.423 May 2017Nothing published for this version
-
0.2.319 May 2017Nothing published for this version
-
0.2.211 Apr 2017Nothing published for this version
-
0.2.105 Apr 2017Nothing published for this version
-
0.2.004 Apr 2017Nothing published for this version
-
0.1.122 Mar 2017Nothing published for this version
-
0.1.017 Mar 2017Nothing published for this version