rnet.http2
Configuration options for HTTP/2 connections, including stream priorities and settings.
rnet.http2
HTTP/2 connection configuration.
PseudoId
Bases: Enum
Represents the order of HTTP/2 pseudo-header fields in the header block.
HTTP/2 pseudo-header fields are a set of predefined header fields that start with ':'. The order of these fields in a header block is significant. This enum defines the possible pseudo-header fields and their standard order according to RFC 7540.
Source code in rnet/http2.py
SettingId
Bases: Enum
An enum that lists all valid settings that can be sent in a SETTINGS frame.
Each setting has a value that is a 32 bit unsigned integer (6.5.1.).
See https://datatracker.ietf.org/doc/html/rfc9113#name-defined-settings.
Source code in rnet/http2.py
HEADER_TABLE_SIZE
class-attribute
instance-attribute
This setting allows the sender to inform the remote endpoint of the maximum size of the compression table used to decode field blocks, in units of octets. The encoder can select any size equal to or less than this value by using signaling specific to the compression format inside a field block (see COMPRESSION). The initial value is 4,096 octets.
ENABLE_PUSH
class-attribute
instance-attribute
Enables or disables server push.
MAX_CONCURRENT_STREAMS
class-attribute
instance-attribute
Specifies the maximum number of concurrent streams.
INITIAL_WINDOW_SIZE
class-attribute
instance-attribute
Sets the initial stream-level flow control window size.
MAX_FRAME_SIZE
class-attribute
instance-attribute
Indicates the largest acceptable frame payload size.
MAX_HEADER_LIST_SIZE
class-attribute
instance-attribute
Advises the peer of the max field section size.
ENABLE_CONNECT_PROTOCOL
class-attribute
instance-attribute
Enables support for the Extended CONNECT protocol.
StreamId
A stream identifier, as described in Section 5.1.1 of RFC 7540.
Streams are identified with an unsigned 31-bit integer. Streams initiated by a client MUST use odd-numbered stream identifiers; those initiated by the server MUST use even-numbered stream identifiers. A stream identifier of zero (0x0) is used for connection control messages; the stream identifier of zero cannot be used to establish a new stream.
Source code in rnet/http2.py
StreamDependency
Represents a stream dependency in HTTP/2 priority frames.
A stream dependency consists of three components: * A stream identifier that the stream depends on * A weight value between 0 and 255 (representing 1-256 in the protocol) * An exclusive flag indicating whether this is an exclusive dependency
Stream Dependencies
In HTTP/2, stream dependencies form a dependency tree where each stream can depend on another stream. This creates a priority hierarchy that helps determine the relative order in which streams should be processed.
Source code in rnet/http2.py
Priority
Represents an HTTP/2 PRIORITY frame (type=0x2).
The PRIORITY frame specifies the sender-advised priority of a stream, as described in RFC 7540 Section 5.3. It can be sent in any stream state, including idle or closed streams.
A PRIORITY frame consists of: * The stream identifier whose priority is being set * A StreamDependency object describing the dependency and weight
Source code in rnet/http2.py
Priorities
A collection of HTTP/2 PRIORITY frames.
The Priorities class maintains an ordered list of Priority frames, which can be used to represent and manage the stream dependency tree in HTTP/2. This is useful for pre-configuring stream priorities or sending multiple PRIORITY frames at once during connection setup or stream reprioritization.
Source code in rnet/http2.py
PseudoOrder
Represents the order of HTTP/2 pseudo-header fields in the header block.
The PseudoOrder class maintains a list of PseudoId values that define the order in which pseudo-header fields should appear in an HTTP/2 HEADERS frame. This is important because the order of pseudo-headers is significant and must follow specific rules as defined in RFC 7540.
Source code in rnet/http2.py
SettingsOrder
Represents the order of HTTP/2 settings parameters in the SETTINGS frame.
The SettingsOrder class maintains a list of SettingId values that define the order in which settings parameters should appear in an HTTP/2 SETTINGS frame. While the order of settings is not strictly enforced by the protocol, having a consistent order can help with readability and debugging.
Source code in rnet/http2.py
Params
Bases: TypedDict
All parameters for HTTP/2 connections.
Source code in rnet/http2.py
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 | |
initial_connection_window_size
instance-attribute
Initial connection-level window size.
initial_max_send_streams
instance-attribute
Initial maximum number of send streams.
max_concurrent_streams
instance-attribute
Maximum concurrent streams from remote peer.
keep_alive_interval
instance-attribute
Interval for HTTP/2 keep-alive ping frames.
keep_alive_timeout
instance-attribute
Timeout for keep-alive ping acknowledgements.
keep_alive_while_idle
instance-attribute
Whether keep-alive applies while idle.
enable_connect_protocol
instance-attribute
Whether to enable the CONNECT protocol.
no_rfc7540_priorities
instance-attribute
Whether to disable RFC 7540 Stream Priorities.
max_concurrent_reset_streams
instance-attribute
Max concurrent locally reset streams.
max_pending_accept_reset_streams
instance-attribute
Max pending accept reset streams.
headers_stream_dependency
instance-attribute
Stream dependency for outgoing HEADERS.
headers_pseudo_order
instance-attribute
Order of pseudo-header fields in HEADERS.
Http2Options
Configuration for an HTTP/2 connection.
This struct defines various parameters to fine-tune the behavior of an HTTP/2 connection, including stream management, window sizes, frame limits, and header config.