module WebSocket

Nested Classes and Modules

class BinaryFrame

Represents a binary frame that is sent or received by a WebSocket connection.

class CloseFrame

Represents a close frame that is sent or received by a WebSocket connection.

module Coder
class Connection

Wraps a framer and implements for implementing connection specific interactions like reading and writing text.

class ContinuationFrame

Represents a continuation frame that is sent or received by a WebSocket connection when a message is split into multiple frames.

class Error

Represents an error that occurred during the WebSocket protocol negotiation or communication. Status codes as defined by https://tools.ietf.org/html/rfc6455#section-7.4.1.

class ProtocolError

Raised by stream or connection handlers, results in GOAWAY frame which signals termination of the current connection. You cannot recover from this exception, or any exceptions subclassed from it.

class ClosedError

The connection was closed, maybe unexpectedly.

class FrameSizeError

When the frame payload does not match expectations.

module Extension
module Extensions

Manages WebSocket extensions negotiated during the handshake.

class Frame

Represents a single WebSocket frame as defined by RFC 6455.

class Framer

Wraps an underlying Async::IO::Stream for reading and writing binary data into structured frames.

module Headers
class Message

Represents a message that can be sent or received over a WebSocket connection.

class TextMessage

Represents a text message that can be sent or received over a WebSocket connection.

class BinaryMessage

Represents a binary message that can be sent or received over a WebSocket connection.

class PingMessage

Represents a ping message that can be sent over a WebSocket connection.

class PingFrame

Represents a ping frame that is sent or received by a WebSocket connection.

class PongFrame

Represents a pong frame that is sent or received by a WebSocket connection.

class TextFrame

Represents a text frame that is sent or received by a WebSocket connection.

Definitions

FRAMES

HTTP/2 frame type mapping as defined by the spec.

Implementation

FRAMES = {
	0x0 => ContinuationFrame,
	0x1 => TextFrame,
	0x2 => BinaryFrame,
	0x8 => CloseFrame,
	0x9 => PingFrame,
	0xA => PongFrame,
}.freeze

MAXIMUM_ALLOWED_FRAME_SIZE = 2**63

The maximum allowed frame size in bytes.