Skip to content

Conversation

segfault87
Copy link

@segfault87 segfault87 commented Nov 6, 2024

PR Type

Feature

PR Checklist

  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • A changelog entry has been made for the appropriate packages.
  • Format code with the latest stable rustfmt.
  • (Team) Label with affected crates and semver status.

Overview

This PR implements DEFLATE compression (specifically permessage-deflate extension which defined at RFC 7692) support for WebSocket.
The whole feature is flagged behind compress-ws-deflate feature.
Currently, flate2 requires zlib for certain feature required by permessage-deflate extension. Therefore using this feature will introduce extra zlib dependency.

Also, Codec has been modified to split into Encoder and Decoder as there are some cases when encoding and decoding take place in different producer/consumers. Still its interface is unmodified in order to prevent API compatibility breakage.

A PR counterpart on actix-ws will follow.

@segfault87
Copy link
Author

On the idea of implementing the extension outside of actix-http, I elaborated a bit at this comment: actix/actix-extras#479 (comment)

Copy link
Contributor

@asonix asonix left a comment

Choose a reason for hiding this comment

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

There's a lot here but I think overall this looks good :) It's unfortunate that this is a breaking change to the public API in a few places. I'm not sure what the plan is for a new major version of actix-http/actix-web although I assume there's no immediate plans for such a release.

@segfault87
Copy link
Author

@robjtede Could you have a look at this?

@robjtede robjtede added A-awc project: awc A-http project: actix-http B-semver-minor labels May 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-awc project: awc A-http project: actix-http B-semver-minor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants