flux v0.1.1 Flux.Websocket

An implementation of the websocket server protocol defined in IETF RFC6455.

Link to this section Summary

Functions

Sends a frame through the given connection. Returns the provided conn if successful

Upgrades a flux http connection with the proper websocket upgrade request to a websocket connection. Requires a Flux.Conn as the first argument, a module that implements the behavior Flux.Websocket.Handler as the second arguemnt, and accepts any arbitrary data to be passed to the handler’s init/2 function as the third argument. If successful, this function will hijack the process that called it for the line of the websocket connection

Link to this section Functions

Link to this function handshake(conn, http_conn)
Link to this function receive_loop(conn, arg)
Link to this function send_frame(conn, frame)
send_frame(Conn.t(), iodata()) :: Conn.t()

Sends a frame through the given connection. Returns the provided conn if successful.

Link to this function upgrade(http_conn, handler, args)
upgrade(Flux.Conn.t(), module(), any()) :: :ok | :error

Upgrades a flux http connection with the proper websocket upgrade request to a websocket connection. Requires a Flux.Conn as the first argument, a module that implements the behavior Flux.Websocket.Handler as the second arguemnt, and accepts any arbitrary data to be passed to the handler’s init/2 function as the third argument. If successful, this function will hijack the process that called it for the line of the websocket connection.