Mint.WebSocket.Extension.init
init
, go back to Mint.WebSocket.Extension module for more information.
Specs
Invoked when the WebSocket server accepts an extension
This callback should be used to initialize any :state
that the extension
needs to operate. For example, this callback is used by the
"permessage-deflate" extension to setup t::zlib.zstream()
s and store
them in state.
The all_extensions
argument is passed so that the extension can know
about the existence and ordering of other extensions. This can be useful
if a client declares multiple extensions which accomplish the same job
(such as multiple compression extensions) but want to only enable one based
on what the server accepts.
Note that extensions are initialized in the order in which the server accepts
them: any extensions preceeding this_extension
in all_extensions
are
initialized while any extensions after this_extension
are not yet
initialized.
Error tuples bubble up to Mint.WebSocket.upgrade/4
.