flux v0.1.1 Flux.Websocket.Frame
Convenience functions for building websocket frames.
Link to this section Summary
Types
Atom representations of the various opcodes that are available when building a websocket frame
A parsed frame recieved from a client
Functions
Builds a server websocket frame with the given opcode and payload. Supports binaries and iodata as payloads. Because this is a server frame, it does NOT mask the payload
Gives the integer that an opcode atom represents For example:
iex(1)> opcode_from_atom(:text)
1
Gives the corresponding atomic representation of an opcode For example:
iex(1)> opcode_to_atom(1)
:text
Link to this section Types
Atom representations of the various opcodes that are available when building a websocket frame.
t() :: %Flux.Websocket.Frame{
close_code: pos_integer() | nil,
fin: boolean(),
mask: integer(),
mask?: boolean(),
opcode: atom(),
payload: binary() | iodata(),
payload_length: non_neg_integer(),
reserved: map()
}
A parsed frame recieved from a client.
Link to this section Functions
Builds a server websocket frame with the given opcode and payload. Supports binaries and iodata as payloads. Because this is a server frame, it does NOT mask the payload.
Gives the integer that an opcode atom represents For example:
iex(1)> opcode_from_atom(:text)
1
Gives the corresponding atomic representation of an opcode For example:
iex(1)> opcode_to_atom(1)
:text