class

HTTP2::Connection

Inherits HTTP2::Emitter / Reference / Object

Constants

DEFAULT_SETTINGS = { settings_max_concurrent_streams: 100, }

Our default settings

PREFACE = "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"

First thing a HTTP/2 client sends to the server

SETTINGS_MAP = { settings_header_table_size: 1_u16, settings_enable_push: 2_u16, settings_max_concurrent_streams: 3_u16, settings_initial_window_size: 4_u16, settings_max_frame_size: 5_u16, settings_max_header_list_size: 6_u16, }

Settings name/id mapping

SPEC_DEFAULT_SETTINGS = { settings_header_table_size: 4096, settings_enable_push: 1, settings_max_concurrent_streams: Frame::MAX_STREAM_ID, settings_initial_window_size: 65535, settings_max_frame_size: 16384, settings_max_header_list_size: (2 ** 31) - 1, }

Default connection settings as defined in RFC 7540

Constructors

new(io)
Source

Instance methods

find_or_create_stream(stream_id)
Source
hpack_decoder
Source
hpack_encoder
Source
inspect

Returns an unambiguous and information-rich string representation of this object, typically intended for developers.

This method should usually not be overridden. It delegates to #inspect(IO) which can be overridden for custom implementations.

Also see #to_s.

Source
new_stream_id
Source
process_headers(frame : Frame)
Source
process_ping(frame : Frame)
Source
process_settings(frame : Frame)
Source
process_window_update(frame)
Source
receive_and_process_frame
Source
receive_continuation_frames(stream : Stream)
Source
receive_frame(type : Frame::Type = nil)
Source
receive_preface
Source
reserve_push_stream
Source
send_frame(frame : Frame)

Converts the Frame to bytes and sends it to the other endpoint. TODO: split HEADERS, PUSH_PROMISE and DATA frames if needed

Source
send_goaway(error_code : Error::Code)
Source
send_rst_stream(error_code : Error::Code)
Source
send_settings
Source