WebsockexAdapter.Frame (WebsockexAdapter v0.1.1)
View SourceWebSocket frame encoding and decoding utilities.
Summary
Functions
Encode binary message as WebSocket frame.
Decode incoming WebSocket frame. Handles both Gun WebSocket format {:ws, type, data} and direct frame format {:type, data}.
Create ping frame.
Create pong frame with payload.
Encode text message as WebSocket frame.
Types
@type frame() :: {frame_type(), binary()}
@type frame_type() :: :text | :binary | :ping | :pong | :close
Functions
Encode binary message as WebSocket frame.
Decode incoming WebSocket frame. Handles both Gun WebSocket format {:ws, type, data} and direct frame format {:type, data}.
@spec ping() :: frame()
Create ping frame.
Create pong frame with payload.
Encode text message as WebSocket frame.