boostorg / boostorg/beast

client-only permessage-deflate still sends server headers

Open
#2,671 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
4.8k
Forks
694
Avg merge
12h 48m
Merged PRs (30d)
1

Description

I'm using boost 1.81 and beast to connect as a client to a remote websocket host, and with compression disabled, everything works fine.

This endpoint supports permessage-deflate from clients, and will also fail to upgrade if any server deflate headers are included.

If I try to add compression like so:
```
auto ret = std::make_shared(io_ctx, ssl_ctx);
boost::beast::websocket::permessage_deflate pd_option{false, true};
ret->set_option(pd_option);
```

The upgrade headers still include `server_max_window_bits`, and the websocket upgrade is rejected. The issue seems to be in the translation between `pd_option` and beast's internal `pmd_offer`; the latter seems to support client and server at once only.

Attempts to set the server window size to 0 to prevent the field from being written (looking at the source of pmd_extension.ipp) yield an invalid value error.

Would it be possible for `pmd_offer` to respect the `pd_option`'s server_enable flag and not send those headers?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.