Skip to content

Latest commit

 

History

History
64 lines (32 loc) · 1.57 KB

elli_ws_protocol.md

File metadata and controls

64 lines (32 loc) · 1.57 KB

Module elli_ws_protocol

Websocket protocol implementation.

Data Types


close_code() = 1000..4999

frame() = close | ping | pong | {text | binary | close | ping | pong, iodata()} | {close, close_code(), iodata()}

Function Index

upgrade/4Upgrade an HTTP request to the Websocket protocol.

Function Details

upgrade/4


upgrade(Req, Env, Handler::module(), HandlerOpts::any()) -> {ok, Req, Env} | {error, 400, Req} | {suspend, module(), atom(), [any()]}

Upgrade an HTTP request to the Websocket protocol.

You do not need to call this function manually. To upgrade to the Websocket protocol, you simply need to return {upgrade, protocol, elli_ws_protocol} in your cowboy_http_handler:init/3 handler function.

To do
* Remove when we support only R16B+.