Skip to content

Commit 8eca1c0

Browse files
authored
Add support for deflate_options configuration (#21)
* Pass deflate_opts cowboy option * Mention new option in the docs, use bandit's deflate_options * Fix how deflate options is passed
1 parent de47c4e commit 8eca1c0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/websock_adapter.ex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ defmodule WebSockAdapter do
5555
the performance of the server. Higher values reduce the number of times Cowboy need to request more
5656
packets from the port driver at the expense of potentially higher memory being used.
5757
This option does not apply to Websocket over HTTP/2
58+
* `deflate_options`: A keyword list of options to pass to the deflate library.
59+
See `Bandit` or `:cow_ws` documentation for more details
5860
"""
5961
@spec upgrade(Plug.Conn.t(), WebSock.impl(), WebSock.state(), [connection_opt()]) ::
6062
Plug.Conn.t()
@@ -83,6 +85,7 @@ defmodule WebSockAdapter do
8385
{:max_frame_size, _} = opt -> [opt]
8486
{:validate_utf8, _} = opt -> [opt]
8587
{:active_n, _} = opt -> [opt]
88+
{:deflate_options, deflate_options} -> [deflate_opts: deflate_options]
8689
_other -> []
8790
end)
8891
|> Map.new()

0 commit comments

Comments
 (0)