nopasaran.http_2_utils

Functions

create_socket(host, port[, is_server])

Create and configure a socket

create_ssl_context([is_client, ...])

Create SSL context with the specified protocol

format_headers(headers_dict)

Convert headers dictionary to h2 compatible format Args: headers_dict: Dictionary containing pseudo_headers and regular_headers Returns: List of (name, value) tuples in correct order

generate_temp_certificates()

Generate temporary self-signed certificates for TLS testing

load_embedded_certificates(ssl_context)

Load embedded certificates by writing to temporary files

send_continuation_frame(conn, sock, frame_data)

Send a CONTINUATION frame

send_data_frame(conn, frame_data[, ...])

Send a DATA frame

send_frame(conn, sock, frame_data[, ...])

Send a single H2 frame Args: conn: H2Connection instance sock: Socket to send data on frame_data: Frame configuration from test case is_server: Whether the frame is being sent from the server cloudflare_origin: Whether the frame is being sent from the cloudflare origin

send_goaway_frame(conn, sock, frame_data)

Send a GOAWAY frame

send_headers_frame(conn, sock, frame_data[, ...])

Send a HEADERS frame

send_ping_frame(conn, sock, frame_data)

Send a PING frame

send_priority_frame(conn, sock, frame_data)

send_push_promise_frame(conn, sock, frame_data)

Send a PUSH_PROMISE frame

send_rst_stream_frame(conn, sock, frame_data)

Send a RST_STREAM frame

send_settings_frame(conn, sock, frame_data)

Send a SETTINGS frame with optional stream ID

send_trailers_frame(conn, sock, frame_data)

Send a TRAILERS frame

send_unknown_frame(sock, frame_data[, ...])

Send an UNKNOWN frame

send_window_update_frame(conn, sock, frame_data)

Send a WINDOW_UPDATE frame

Classes

SSL_CONFIG()

SSL configuration constants