module HTTP2
Nested Classes and Modules
class ClientRepresents an HTTP/2 client connection. Manages client-side protocol semantics including stream ID allocation, connection preface handling, and push promise processing.
class ConnectionThis is the core connection class that handles HTTP/2 protocol semantics including stream management, settings negotiation, and frame processing.
module ContinuedModule for frames that can be continued with CONTINUATION frames.
class ContinuationFrameThe CONTINUATION frame is used to continue a sequence of header block fragments. Any number of CONTINUATION frames can be sent, as long as the preceding frame is on the same stream and is a HEADERS, PUSH_PROMISE, or CONTINUATION frame without the END_HEADERS flag set.
class DataFrameDATA frames convey arbitrary, variable-length sequences of octets associated with a stream. One or more DATA frames are used, for instance, to carry HTTP request or response payloads.
class ErrorStatus codes as defined by https://tools.ietf.org/html/rfc7540#section-7.
class HandshakeErrorRaised if connection header is missing or invalid indicating that this is an invalid HTTP 2.0 request - no frames are emitted and the connection must be aborted.
class ProtocolErrorRaised 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 StreamErrorRepresents an error specific to stream operations.
class StreamClosedRepresents an error for operations on closed streams.
class GoawayErrorRepresents a GOAWAY-related protocol error.
class FrameSizeErrorWhen the frame payload does not match expectations.
class HeaderErrorRepresents a header processing error.
class FlowControlErrorRaised on invalid flow control frame or command.
module FlowControlledProvides flow control functionality for HTTP/2 connections and streams. This module implements window-based flow control as defined in RFC 7540.
class FrameRepresents the base class for all HTTP/2 frames. This class provides common functionality for frame parsing, serialization, and manipulation according to RFC 7540.
class FramerHandles frame serialization and deserialization for HTTP/2 connections. This class manages the reading and writing of HTTP/2 frames to/from a stream.
class GoawayFrameThe GOAWAY frame is used to initiate shutdown of a connection or to signal serious error conditions. GOAWAY allows an endpoint to gracefully stop accepting new streams while still finishing processing of previously established streams. This enables administrative actions, like server maintenance.
class HeadersFrameThe HEADERS frame is used to open a stream, and additionally carries a header block fragment. HEADERS frames can be sent on a stream in the "idle", "reserved (local)", "open", or "half-closed (remote)" state.
module PaddedCertain frames can have padding: https://http2.github.io/http2-spec/#padding
module AcknowledgementProvides acknowledgement functionality for frames that support it. This module handles setting and checking acknowledgement flags on frames.
class PingFrameThe PING frame is a mechanism for measuring a minimal round-trip time from the sender, as well as determining whether an idle connection is still functional. PING frames can be sent from any endpoint.
class PriorityUpdateFrameThe PRIORITY_UPDATE frame is used by clients to signal the initial priority of a response, or to reprioritize a response or push stream. It carries the stream ID of the response and the priority in ASCII text, using the same representation as the Priority header field value.
class PushPromiseFrameThe PUSH_PROMISE frame is used to notify the peer endpoint in advance of streams the sender intends to initiate. The PUSH_PROMISE frame includes the unsigned 31-bit identifier of the stream the endpoint plans to create along with a set of headers that provide additional context for the stream.
class ResetStreamFrameThe RST_STREAM frame allows for immediate termination of a stream. RST_STREAM is sent to request cancellation of a stream or to indicate that an error condition has occurred.
class ServerRepresents an HTTP/2 server connection. Manages server-side protocol semantics including stream ID allocation, connection preface handling, and settings negotiation.
class SettingsHTTP/2 connection settings container and management.
class PendingSettingsManages pending settings changes that haven't been acknowledged yet.
class SettingsFrameThe SETTINGS frame conveys configuration parameters that affect how endpoints communicate, such as preferences and constraints on peer behavior. The SETTINGS frame is also used to acknowledge the receipt of those parameters. Individually, a SETTINGS parameter can also be referred to as a "setting".
class StreamA single HTTP/2 connection can multiplex multiple streams in parallel: multiple requests and responses can be in flight simultaneously and stream data can be interleaved and prioritized.
class WindowFlow control window for managing HTTP/2 data flow.
class LocalWindowThis is a window which efficiently maintains a desired capacity.
class WindowUpdateFrameThe WINDOW_UPDATE frame is used to implement flow control.
Definitions
FRAMES
HTTP/2 frame type mapping as defined by the spec
Implementation
FRAMES = [
DataFrame,
HeadersFrame,
nil, # PriorityFrame is deprecated and ignored, instead consider using PriorityUpdateFrame instead.
ResetStreamFrame,
SettingsFrame,
PushPromiseFrame,
PingFrame,
GoawayFrame,
WindowUpdateFrame,
ContinuationFrame,
nil,
nil,
nil,
nil,
nil,
nil,
PriorityUpdateFrame,
].freeze
CONNECTION_PREFACE = "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n".freeze
Default connection "fast-fail" preamble string as defined by the spec.