Module cowboy_websocket

Websocket protocol implementation.

Behaviours: cowboy_sub_protocol.

Description

Websocket protocol implementation.

Cowboy supports versions 7 through 17 of the Websocket drafts. It also supports RFC6455, the proposed standard for Websocket.

Data Types

close_code()

close_code() = 1000..4999

frame()

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

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, cowboy_websocket} in your cowboy_http_handler:init/3 handler function.


Generated by EDoc, Aug 16 2014, 11:28:19.