Skip to content

feat: pass WebSocket frame limits through ws_connect - #1039

Open
Fudoshiki wants to merge 1 commit into
benoitc:masterfrom
Youimmi:ws-connect-frame-limits
Open

Fudoshiki wants to merge 1 commit into
benoitc:masterfrom
Youimmi:ws-connect-frame-limits

Conversation

@Fudoshiki

@Fudoshiki Fudoshiki commented Nov 18, 2026 •

Copy link
Copy Markdown

What

hackney:ws_connect/2 now accepts max_frame_size and max_message_size and passes them to hackney_ws. When they are not given, the hackney_ws defaults (16 MiB and 64 MiB) still apply.

Why

The limits added for GHSA-q8jg can only be set through hackney_ws:start_link/1. Clients that use the public ws_connect/2 API cannot lower them, for example a memory-constrained device whose protocol never sends frames larger than about 1 MiB.

How to test

rebar3 eunit --module=hackney_ws_tests runs the new "ws_connect passes max_frame_size" test. It connects through hackney:ws_connect/2 with max_frame_size set to 100 and expects {error, {frame_too_big, _}} for a 5,000-byte frame. Without the change, the test fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant