Websocket protocol implementation.
close_code() = 1000..4999
frame() = close | ping | pong | {text | binary | close | ping | pong, iodata()} | {close, close_code(), iodata()}
upgrade/4 | Upgrade an HTTP request to the Websocket protocol. |
upgrade(Req, Env, Handler::module(), HandlerOpts::any()) -> {ok, Req, Env} | {error, 400, Req} | {suspend, module(), atom(), [any()]}
Req = elli_ws_request_adapter:req()
Env = list()
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+.