View Source ow_websocket (overworld v2.0.0)
Summary
Functions
Handler is initialized for any new connection and logs the foreign IP
Terminate callback for cleanup processes
The websocket handler passes any binary message down to the protocol decoder for further processing. All other messages are discarded.
websocket_info is triggered when a message from another erlang process comes into this handler process.
Set up the initial state of the websocket handler
Types
Functions
-spec init(cowboy_req:req(), any()) -> {cowboy_websocket, cowboy_req:req(), any()}.
Handler is initialized for any new connection and logs the foreign IP
-spec terminate(any(), cowboy_req:req(), pid()) -> ok.
Terminate callback for cleanup processes
-spec websocket_handle({binary, [binary(), ...]}, pos_integer()) -> ws_result().
The websocket handler passes any binary message down to the protocol decoder for further processing. All other messages are discarded.
-spec websocket_info({From, client_msg, Msg}, SessionPid) -> Reply when From :: pid(), Msg :: binary(), SessionPid :: pid(), Reply :: {reply, {binary, Msg1}, SessionPid1}, Msg1 :: binary(), SessionPid1 :: pid().
websocket_info is triggered when a message from another erlang process comes into this handler process.
Set up the initial state of the websocket handler