642 Commits

Author SHA1 Message Date
Daniel Abramov
c2921718b7 Suppress clippy warnings in tests/
Some checks failed
CI / Format (push) Has been cancelled
CI / Clippy (push) Has been cancelled
CI / Test (stable) (push) Has been cancelled
CI / Test MSRV (1.71.1) (push) Has been cancelled
CI / Autobahn tests (beta) (push) Has been cancelled
CI / Autobahn tests (nightly) (push) Has been cancelled
CI / Autobahn tests (stable) (push) Has been cancelled
This is a known issue as these kind of warnings are already disabled on
the lib.rs level in the crate.
v0.29.0
2026-03-17 16:22:02 +01:00
Daniel Abramov
0938f1c79b Bump version 2026-03-17 14:45:11 +01:00
zmnxc1
4a457f65d9 Add missing word to the comment (#521)
Co-authored-by: Your Name <you@example.com>
2026-03-03 12:38:47 +01:00
Zen
aef32231f5 Fix grammar in WebSocketContext::from_partially_read docs (#534) 2026-03-03 01:24:57 +01:00
Simon Sapin
ad6539bcb9 Inline the utf-8 crate (#536)
* Inline the utf-8 crate

Fixes https://github.com/snapview/tungstenite-rs/issues/333

* clippy

* rustfmt nightly
2026-03-02 23:56:59 +01:00
Daniel Abramov
df722bd668 Update the CI to accomodate for the new MSRV 2026-03-02 23:51:11 +01:00
Daniel Abramov
9833bdec33 Bump MSRV 2026-03-02 23:47:32 +01:00
Daniel Abramov
59bee6404f Fix formatting in CHANGELOG.md 2026-02-07 21:19:51 +01:00
Daniel Abramov
3f2f222cd8 Update CHANGELOG.md
Add note about the support of header values.
2026-02-07 21:19:36 +01:00
Zach FettersMoore
84eaba964d Fixing issue with non-ASCII header values
Fixing an issue where non-ASCII header values cause websocket handshake to fail.
2026-02-07 21:08:16 +01:00
Daniel Abramov
236c121e08 Fix CI/CD to work with rust 1.68.2 2026-01-05 20:34:27 +01:00
Daniel Abramov
4263fe1bff Update rust-version to 1.68.2
The previous version was too low and triggered errors in the CI/CI since some of the dependencies have set their MSRV to `1.68`.
2026-01-05 18:40:09 +01:00
Daniel Abramov
2d4abe8dba Bump version (0.28.0)
Some checks failed
CI / Format (push) Has been cancelled
CI / Clippy (push) Has been cancelled
CI / Test (stable) (push) Has been cancelled
CI / Test MSRV (1.63.0) (push) Has been cancelled
CI / Autobahn tests (beta) (push) Has been cancelled
CI / Autobahn tests (nightly) (push) Has been cancelled
CI / Autobahn tests (stable) (push) Has been cancelled
v0.28.0
2025-09-24 14:13:31 +02:00
Daniel Abramov
c0a099e3d1 refactor: simplify processing incoming data frames 2025-09-14 18:32:33 +02:00
Alex Bakon
e7e060a89a Replace if let Some(...) with .ok_or(...)? 2025-09-11 18:47:46 +02:00
Alex Bakon
a52682983c Refactor top-level branch with early error return 2025-09-11 18:47:46 +02:00
Abhishek Kumar
b0488dd61a Implement into_inner to get the underlying stream (#516) 2025-09-10 19:43:09 +02:00
Alex Bakon
6520d8f49f Avoid a Vec allocation during handshaking (#514) 2025-09-05 22:47:39 +02:00
Moray Breckinridge
406597113c Proper strigification of http::Version (#513)
It's bad idea to use `fmt::Debug` here because debug is inherently
non-stable and also because it breaks with `-Zfmt-debug=none`.

I'm not adding patch for `http` create because `http` strigification
doesn't make any sense for http2 and http3 (i.e. it is never used
on the wire).
2025-08-15 15:08:15 +02:00
Thomas de Zeeuw
7c4ad5bae6 Update to socket2 v0.6 (#505) 2025-08-08 14:59:30 +02:00
Alex Butler
9482a478f5 Reduce Error size 136 -> 32 (#511)
* Box Error::Http

Reduce Error size 136 -> 56

* Box Error::WriteBufferFull

Reduce Error size 56 -> 40

* Box ProtocolError::InvalidHeader, TlsError::Native, TlsError::Rustls

Reduce ProtocolError size 40 -> 16
Reduce TlsError size 64 -> 16
Reduce Error size 40/64 -> 32

* Update changelog

* Make the code worse so users can use old rustc from 2022
2025-07-24 12:50:33 +02:00
Constantin Nickel
7f3d46eaff Fix clippy warnings: Inline format! args 2025-07-09 14:10:39 +02:00
Daniel Abramov
3ffeb33e29 Prepare 0.27.0 release
Some checks failed
CI / Format (push) Has been cancelled
CI / Clippy (push) Has been cancelled
CI / Test (stable) (push) Has been cancelled
CI / Test MSRV (1.63.0) (push) Has been cancelled
CI / Autobahn tests (beta) (push) Has been cancelled
CI / Autobahn tests (nightly) (push) Has been cancelled
CI / Autobahn tests (stable) (push) Has been cancelled
v0.27.0
2025-06-13 23:25:09 +02:00
Alex Butler
5e15390029 When reading avoid over-reserving the in the case WouldBlock causes multiple read_frame calls (#501)
* When reading avoid over-reserving the in the case WouldBlock causes multiple read_frame calls

* Do max_size check once after header parse
2025-05-24 19:08:22 +02:00
Alex Butler
d8b45ee3e7 Add end to end "send+recv" benchmarks (#497)
* Add end to end "send+recv" benchmarks

* Add e2e required-features to manifest

* Add byte throughput measurements

* Reduce down to 8x bench variants

* Use 127.0.0.1 for client & server ip

* Use None max message/frame config
2025-05-24 00:43:53 +02:00
Alex Butler
f20436ca16 Update src/protocol/frame/frame.rs
Co-authored-by: Daniel Abramov <inetcrack2@gmail.com>
2025-05-23 22:19:50 +02:00
Alex Butler
e4fb204fb0 Don't allow zero in_buf_max_read 2025-05-23 22:19:50 +02:00
Alex Butler
1dc706ced6 Fix large message read performance by enforcing max read_buffer_size read chunks 2025-05-23 22:19:50 +02:00
Benjamin
255aaa2c0c add more details for utf8 errors for debugging
Signed-off-by: Benjamin <5719034+bnjjj@users.noreply.github.com>
2025-04-09 16:39:50 +02:00
Andrei Nesterov
75b59d9792 Implement From<Bytes> for Message 2025-04-01 23:35:19 +02:00
yhx-12243
56d758bebd fix(Utf8Bytes): hash consistency for Borrow + Hash traits 2025-02-20 21:37:25 +01:00
Daniel Abramov
bb7a58a7bd Bump version
Some checks failed
CI / Format (push) Has been cancelled
CI / Clippy (push) Has been cancelled
CI / Test (stable) (push) Has been cancelled
CI / Test MSRV (1.63.0) (push) Has been cancelled
CI / Autobahn tests (beta) (push) Has been cancelled
CI / Autobahn tests (nightly) (push) Has been cancelled
CI / Autobahn tests (stable) (push) Has been cancelled
v0.26.2
2025-02-18 11:44:58 +01:00
Sebastian Dröge
4eb26c5f01 Implement PartialOrd and Ord for Utf8Bytes 2025-02-18 11:40:53 +01:00
Sebastian Dröge
34e417bfa2 Derive Hash for Utf8Bytes 2025-02-18 11:40:53 +01:00
Sebastian Dröge
d1229ecc58 Implement Borrow<str>, AsRef<[u8]>, AsRef<str> and AsRef<Bytes> for `Utf8Bytes 2025-02-18 11:40:53 +01:00
Alex Butler
8cfd027674 Add WebSocketConfig::read_buffer_size docs explaining performance/memory tradeoff (#482)
Update 0.25.0 changelog with change to memory use.
2025-02-07 15:15:19 +01:00
dependabot[bot]
5e67ba6f5d Update rand requirement from 0.8.0 to 0.9.0 (#481)
Updates the requirements on [rand](https://github.com/rust-random/rand) to permit the latest version.
- [Release notes](https://github.com/rust-random/rand/releases)
- [Changelog](https://github.com/rust-random/rand/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-random/rand/compare/0.8.4...0.9.0)

---
updated-dependencies:
- dependency-name: rand
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-28 12:43:08 +01:00
Marek Kuskowski
c16778797b Remove byteorder, use bytes::Buf::get_uint instead (#477)
* Remove byteorder, use bytes::Buf::get_uint instead

* avoid unecessary copy inside bytes::Buf::get_uint

* use assert! to verify length number
2025-01-08 21:10:42 +01:00
Théodore Prévot
763284862f feat: add unsafe Utf8Bytes::from_bytes_unchecked (#476)
* feat: add

* doc(utf8): add a safety section for unsafe `from_bytes_unchecked`
2025-01-08 20:47:35 +01:00
Alex Butler
b7a7817efc Keep the set-len refactor but use safe resize 2024-12-19 16:02:54 +01:00
Alex Butler
f05398bd2c Revert "Revert "Use set-len when reading into buffer""
This reverts commit e81886c80c.
2024-12-19 16:02:54 +01:00
Daniel Abramov
1b4adde57d Bump version
Some checks failed
CI / Format (push) Has been cancelled
CI / Clippy (push) Has been cancelled
CI / Test (stable) (push) Has been cancelled
CI / Test MSRV (1.63.0) (push) Has been cancelled
CI / Autobahn tests (beta) (push) Has been cancelled
CI / Autobahn tests (nightly) (push) Has been cancelled
CI / Autobahn tests (stable) (push) Has been cancelled
v0.26.1
2024-12-19 15:31:19 +01:00
Daniel Abramov
e81886c80c Revert "Use set-len when reading into buffer"
This reverts commit 441f29fd2c.
2024-12-19 15:28:35 +01:00
Lena
ec442e6035 message: fix documentation on Message::binary() 2024-12-18 18:08:43 +01:00
Daniel Abramov
fb9c154178 Bump version
Some checks failed
CI / Format (push) Has been cancelled
CI / Clippy (push) Has been cancelled
CI / Test (stable) (push) Has been cancelled
CI / Test MSRV (1.63.0) (push) Has been cancelled
CI / Autobahn tests (beta) (push) Has been cancelled
CI / Autobahn tests (nightly) (push) Has been cancelled
CI / Autobahn tests (stable) (push) Has been cancelled
v0.26.0
2024-12-17 19:28:39 +01:00
Alex Butler
441f29fd2c Use set-len when reading into buffer 2024-12-17 18:02:35 +01:00
Alex Butler
99bef1798b Use shorter import in doc tests 2024-12-17 17:43:44 +01:00
Alex Butler
63db5e9cca re-export Utf8Bytes, Bytes at root 2024-12-17 17:43:44 +01:00
Alex Butler
6505e51476 always shout about SAFETY 2024-12-17 17:43:44 +01:00
Alex Butler
9f52edabe8 cargo fmt 2024-12-17 17:43:44 +01:00