Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.32.0] - 2025-10-31
### Changed
- Update to tungstenite 0.28.

### Added
- Add `WebSocketStream::into_inner()` to get the underlying stream.

## [0.31.0] - 2025-08-09
### Changed
- `WebSocketSender::send()` and `close()` require a mutable reference now.
Expand Down Expand Up @@ -251,7 +258,8 @@ No changelog is available for older versions as of yet.
-->


[Unreleased]: https://github.com/sdroege/async-tungstenite/compare/0.31.0...HEAD
[Unreleased]: https://github.com/sdroege/async-tungstenite/compare/0.32.0...HEAD
[0.32.0]: https://github.com/sdroege/async-tungstenite/compare/0.32.0...0.31.0
[0.31.0]: https://github.com/sdroege/async-tungstenite/compare/0.31.0...0.30.0
[0.30.0]: https://github.com/sdroege/async-tungstenite/compare/0.30.0...0.29.1
[0.29.1]: https://github.com/sdroege/async-tungstenite/compare/0.29.1...0.29.0
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock.msrv

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license = "MIT"
homepage = "https://github.com/sdroege/async-tungstenite"
repository = "https://github.com/sdroege/async-tungstenite"
documentation = "https://docs.rs/async-tungstenite"
version = "0.31.0"
version = "0.32.0"
edition = "2018"
readme = "README.md"
include = ["examples/**/*", "src/**/*", "LICENSE", "README.md", "CHANGELOG.md"]
Expand Down
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,9 @@ In essence, `async-tungstenite` is a wrapper for `tungstenite`, so the performan
has a decent performance (it has been used in production for real-time communication software, video conferencing, etc), but it's definitely
not the fastest WebSocket library in the world at the moment of writing this note.

If performance is of a paramount importance for you (especially if you send **large messages**), then you might want to check other libraries
that have been designed to be performant or you could file a PR against `tungstenite` to improve the performance!
We are aware of changes that both `tungstenite` and `tokio-tungstenite` require in order to make it on-par with slightly more performant libraries like `fastwebsockets`. In the course of past years we have merged several performance improvements submitted by the awesome community of Rust users who helped to improve the library! The more recent versions of `tokio-tungstenite` (`> 0.26.2`) are more performant and should be more on-par with `fastwebsockets`.

We are aware of changes that both `tungstenite` and `async-tungstenite` need in order to fill the gap of ~30% performance difference between `tungstenite`
and more performant libraries like `fastwebsockets`, but we have not worked on that yet as it was not required for the use case that original authors designed
the library for. In the course of past years we have merged several performance improvements submitted by the awesome community of Rust users who helped to improve
the library! For a quick summary of the pending performance problems/improvements, see [the comment](https://github.com/snapview/tungstenite-rs/issues/352#issuecomment-1537488614).
For a quick summary of the pending performance problems/improvements, see [the comment](https://github.com/snapview/tungstenite-rs/issues/352#issuecomment-1537488614).

## tokio-tungstenite

Expand Down
5 changes: 5 additions & 0 deletions src/compat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ impl<S> AllowStd<S> {
}
}
}

/// Returns the underlying stream.
pub(crate) fn into_inner(self) -> S {
self.inner
}
}

// Proxy Waker that we pass to the internal AsyncRead/Write of the
Expand Down
5 changes: 5 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,11 @@ impl<S> WebSocketStream<S> {
f(&mut self.inner)
}

/// Consumes the `WebSocketStream` and returns the underlying stream.
pub fn into_inner(self) -> S {
self.inner.into_inner().into_inner()
}

/// Returns a shared reference to the inner stream.
pub fn get_ref(&self) -> &S
where
Expand Down