@@ -192,16 +192,20 @@ defmodule Bandit do
192192 upgrade requests still need to set the `compress: true` option in `connection_opts` on
193193 a per-upgrade basis for compression to be negotiated (see 'WebSocket Support' section below
194194 for details). Defaults to `true`
195+ * `deflate_options`: A keyword list of options to set on the deflate library when using the
196+ per-message deflate extension. A complete list can be found at `t:deflate_options/0`.
197+ `window_bits` is currently ignored and left to negotiation.
195198 """
196199 @ type websocket_options :: [
197200 { :enabled , boolean ( ) }
198201 | { :max_frame_size , pos_integer ( ) }
199202 | { :validate_text_frames , boolean ( ) }
200203 | { :compress , boolean ( ) }
204+ | { :deflate_options , deflate_options ( ) }
201205 ]
202206
203207 @ typedoc """
204- Options to configure the deflate library used for HTTP compression
208+ Options to configure the deflate library used for HTTP and WebSocket compression
205209 """
206210 @ type deflate_options :: [
207211 { :level , :zlib . zlevel ( ) }
@@ -234,7 +238,7 @@ defmodule Bandit do
234238 @ http_keys ~w( compress deflate_options log_exceptions_with_status_codes log_protocol_errors log_client_closures) a
235239 @ http_1_keys ~w( enabled max_request_line_length max_header_length max_header_count max_requests clear_process_dict gc_every_n_keepalive_requests log_unknown_messages) a
236240 @ http_2_keys ~w( enabled max_header_block_size max_requests max_reset_stream_rate default_local_settings) a
237- @ websocket_keys ~w( enabled max_frame_size validate_text_frames compress primitive_ops_module) a
241+ @ websocket_keys ~w( enabled max_frame_size validate_text_frames compress deflate_options primitive_ops_module) a
238242 @ thousand_island_keys ThousandIsland.ServerConfig . __struct__ ( )
239243 |> Map . from_struct ( )
240244 |> Map . keys ( )
0 commit comments