Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add permessage-deflate support, again #426

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
59ef32d
Revert "Revert "Add `permessage-deflate` support""
SvizelPritula May 15, 2024
1026967
Move SecWebsocketExtensions into repo
SvizelPritula May 15, 2024
3eb047a
Integrate SecWebsocketExtensions header proprerly
SvizelPritula May 15, 2024
6cfff38
Make headers dependency conditional on handshake feature
SvizelPritula May 16, 2024
0fa45db
Allow deflate feature to be used without the handshake feature
SvizelPritula May 16, 2024
bd46107
Expose SecWebsocketExtensions
SvizelPritula May 16, 2024
e937e2a
Add needed #[non_exhaustive] attributes
SvizelPritula May 16, 2024
98a32d7
Stop using initializer syntax to create WebSocketConfig
SvizelPritula May 16, 2024
66841b7
Format srv_accept_unmasked_frames example
SvizelPritula May 16, 2024
049c753
Comply with license of code copied from the headers crate
SvizelPritula Nov 14, 2024
d8a4b61
Merge branch 'master' into permessage-deflate
SvizelPritula Nov 14, 2024
7330193
Revert "Comply with license of code copied from the headers crate"
SvizelPritula Nov 15, 2024
7843d3f
Merge branch 'master' into permessage-deflate
SvizelPritula Nov 15, 2024
3fdf654
Merge branch 'master' into permessage-deflate
SvizelPritula Dec 19, 2024
963238d
Fix compilation errors caused by merge
SvizelPritula Dec 19, 2024
4eaa527
Fix support for MSRV
SvizelPritula Dec 19, 2024
9f75dd6
Merge branch 'master' into permessage-deflate
SvizelPritula Feb 17, 2025
76069c5
Decompress single-frame messages as well
SvizelPritula Feb 17, 2025
d6f7ac8
Fix formatting of srv_accept_unmasked_frames example
SvizelPritula Feb 17, 2025
98f8875
Apply suggestions from code review
SvizelPritula Feb 21, 2025
9b5cff3
Don't copy data before decompression
SvizelPritula Feb 21, 2025
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
target
Cargo.lock
.vscode
autobahn/client/
autobahn/server/
Comment on lines +4 to +5
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
autobahn/client/
autobahn/server/

Probably leftovers from a local testing? :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those folders contain the test results after running scripts/autobahn-client.sh or scripts/autobahn-server.sh. Those shouldn't be commited, so I added them to .gitignore.

12 changes: 9 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,20 @@ all-features = true

[features]
default = ["handshake"]
handshake = ["data-encoding", "http", "httparse", "sha1"]
handshake = ["data-encoding", "headers", "http", "httparse", "sha1"]
url = ["dep:url"]
native-tls = ["native-tls-crate"]
native-tls-vendored = ["native-tls", "native-tls-crate/vendored"]
rustls-tls-native-roots = ["__rustls-tls", "rustls-native-certs"]
rustls-tls-webpki-roots = ["__rustls-tls", "webpki-roots"]
__rustls-tls = ["rustls", "rustls-pki-types"]
deflate = ["flate2"]

[dependencies]
data-encoding = { version = "2", optional = true }
byteorder = "1.3.2"
bytes = "1.0"
headers = { version = "0.4.0", optional = true }
http = { version = "1.0", optional = true }
httparse = { version = "1.3.4", optional = true }
log = "0.4.8"
Expand All @@ -40,6 +42,10 @@ thiserror = "1.0.23"
url = { version = "2.1.0", optional = true }
utf-8 = "0.7.5"

[dependencies.flate2]
optional = true
version = "1.0"

[dependencies.native-tls-crate]
optional = true
package = "native-tls"
Expand Down Expand Up @@ -88,11 +94,11 @@ required-features = ["handshake"]

[[example]]
name = "autobahn-client"
required-features = ["handshake"]
required-features = ["handshake", "deflate"]

[[example]]
name = "autobahn-server"
required-features = ["handshake"]
required-features = ["handshake", "deflate"]

[[example]]
name = "callback-error"
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ Choose the one that is appropriate for your needs.
By default **no TLS feature is activated**, so make sure you use one of the TLS features,
otherwise you won't be able to communicate with the TLS endpoints.

There is no support for permessage-deflate at the moment, but the PRs are welcome :wink:

Testing
-------

Expand Down
Loading