Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/websock_adapter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ defmodule WebSockAdapter do
* `compress`: Whether or not to accept negotiation of a compression extension with the client.
Defaults to `false`
* `max_frame_size`: The maximum frame size to accept, in octets. If a frame size larger than this
is received the connection will be closed. Defaults to `:infinity`
is received the connection will be closed. Defaults to `10_000_000` (10MB)
* `fullsweep_after`: The maximum number of garbage collections before forcing a fullsweep of
the WebSocket connection process. Setting this option requires OTP 24 or newer
* `max_heap_size`: The maximum size of the websocket process heap in words, or a configuration
Expand All @@ -61,6 +61,7 @@ defmodule WebSockAdapter do
@spec upgrade(Plug.Conn.t(), WebSock.impl(), WebSock.state(), [connection_opt()]) ::
Plug.Conn.t()
def upgrade(%{adapter: {adapter, _}} = conn, websock, state, opts) do
opts = Keyword.put_new(opts, :max_frame_size, 10_000_000)
# Do this first so we can identify unsupported adapters
tuple = tuple_for(adapter, websock, state, opts)

Expand Down