View Source WebSockAdapter (WebSockAdapter v0.5.4)
Defines adapters to allow common Web Servers to serve applications via the
Also provides a consistent upgrade facility to upgrade
Plug.Conn requests to
connections for supported servers.
Link to this section Summary
Link to this section Types
Link to this section Functions
This function returns the passed
conn set to an
state value will be used as the argument for
WebSock.init/1 once the WebSocket
connection has been successfully negotiated.
opts keyword list argument allows a number of options to be set on the WebSocket
connection. Not all options may be supported by the underlying HTTP server. Possible values are
timeout: The number of milliseconds to wait after no client data is received before closing the connection. Defaults to
compress: Whether or not to accept negotiation of a compression extension with the client. Defaults to
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
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
validate_utf8: Whether Cowboy should verify that the payload of text and close frames is valid UTF-8. This is required by the protocol specification but in some cases it may be more interesting to disable it in order to save resources. Note that binary frames do not have this UTF-8 requirement and are what should be used under normal circumstances if necessary.
active_n: The number of packets Cowboy will request from the socket at once. This can be used to tweak the performance of the server. Higher values reduce the number of times Cowboy need to request more packets from the port driver at the expense of potentially higher memory being used. This option does not apply to Websocket over HTTP/2.