class

Alumna::Http::WebSocketSession

Inherits Reference < Object

One upgraded socket. provider is always WEBSOCKET_PROVIDER. Handshake headers are copied onto every frame context. One store Hash for the life of the socket (ROADMAP 4.2).

Constructors

new(socket : HTTP::WebSocket, headers : HTTP::Headers, remote_ip : String, app : App)
Source

Instance methods

handle_binary(bytes : Bytes) : Nil

JSON frames are text. Binary is an error reply, not a raise.

Source
handle_text(text : String) : Nil

One text frame → dispatch → one JSON reply. Never raise to the socket loop.

Source
headers
Source
process_frame(text : String) : Hash(String, AnyData)

Parse one frame and run App#dispatch. Used by specs without a live socket.

Source
provider
Source
remote_ip
Source
socket
Source
store
Source
unregister
Source