# _h3_handler

URL: /pounce/api/_h3_handler/
Section: api
Description: HTTP/3 connection handler — manages QUIC/UDP streams via zoomies.

HTTP/3 uses QUIC (UDP) transport. Zoomies is sans-I/O: pounce owns the
UDP loop and maintains a connection map. Each QUIC connection has an
H3Connection; each HTTP/3 stream maps to one ASGI invocation.

Requires the ``h3`` optional dependency (``pip install bengal-pounce[h3]``).

---

> For a complete page index, fetch /pounce/llms.txt.

Open LLM text
(/pounce/api/_h3_handler/index.txt)

Share with AI

Ask Claude
(https://claude.ai/new?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpounce%2Fapi%2F_h3_handler%2Findex.txt)

Ask ChatGPT
(https://chatgpt.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpounce%2Fapi%2F_h3_handler%2Findex.txt)

Ask Gemini
(https://gemini.google.com/app?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpounce%2Fapi%2F_h3_handler%2Findex.txt)

Ask Copilot
(https://copilot.microsoft.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpounce%2Fapi%2F_h3_handler%2Findex.txt)

Module

#
`_h3_handler`

HTTP/3 connection handler — manages QUIC/UDP streams via zoomies.

HTTP/3 uses QUIC (UDP) transport. Zoomies is sans-I/O: pounce owns the
UDP loop and maintains a connection map. Each QUIC connection has an
H3Connection; each HTTP/3 stream maps to one ASGI invocation.

Requires the`h3` optional dependency (`pip install bengal-pounce[h3]`).

2Classes3Functions

## Classes

`_PounceZeroRttPolicy`

1

▼

0-RTT policy that accepts early data at the TLS level.

Application-layer safety (425 Too Early for…

0-RTT policy that accepts early data at the TLS level.

Application-layer safety (425 Too Early for unsafe methods) is enforced
separately in the H3 event handler.

#### Methods

`allow_0rtt`

2

`bool`

▼

`def allow_0rtt(self, ticket_data: bytes, obfuscated_age: int) -> bool`

##### Parameters

Name
Type
Description

`ticket_data`
`—`

`obfuscated_age`
`—`

##### Returns

`bool`

`_ZoomiesConnection`

7

▼

Per-client QUIC + H3 connection state.

Per-client QUIC + H3 connection state.

#### Attributes

Name
Type
Description

`quic`

`Any`

—

`h3`

`Any`

—

`last_activity`

`float`

—

`last_addr`

`tuple[str, int]`

—

`stream_tasks`

`dict[int, tuple[asyncio.Task[None], asyncio.Queue[dict[str, Any]]]]`

—

`stream_body_bytes`

`dict[int, int]`

—

`stream_body_ended`

`set[int]`

—

## Functions

`_make_zero_rtt_policy`

0

`_PounceZeroRttPolicy (/pounce/api/_h3_handler/#_PounceZeroRttPolicy)`

▼

Create a 0-RTT policy for use with QuicConfiguration.

`def _make_zero_rtt_policy() -> _PounceZeroRttPolicy`

##### Returns

`_PounceZeroRttPolicy (/pounce/api/_h3_handler/#_PounceZeroRttPolicy)`

`_create_zoomies_datagram_protocol`

7

`type`

▼

Factory that returns a ZoomiesDatagramProtocol class bound to app/config/logger…

`def _create_zoomies_datagram_protocol(app: ASGIApp, config: ServerConfig, logger: logging.Logger, server: tuple[str, int], quic_config: Any, lifespan_state: dict[str, Any] | None = None, worker_id: int = 0) -> type`

Factory that returns a ZoomiesDatagramProtocol class bound to app/config/logger/server.

##### Parameters

Name
Type
Description

`app`
`ASGIApp`

`config`
`ServerConfig (/pounce/api/config/#ServerConfig)`

`logger`
`logging.Logger`

`server`
`tuple[str, int]`

`quic_config`
`Any`

`lifespan_state`
`dict[str, Any] | None`

Default:`None`

`worker_id`
`int`

Default:`0`

##### Returns

`type`

`create_zoomies_datagram_protocol_factory`

7

`Callable[[], asyncio.Dat…`

▼

Create a factory for ZoomiesDatagramProtocol.

Returns a no-arg callable suitab…

`def create_zoomies_datagram_protocol_factory(app: ASGIApp, config: ServerConfig, logger: logging.Logger, server: tuple[str, int], quic_config: Any, lifespan_state: dict[str, Any] | None = None, worker_id: int = 0) -> Callable[[], asyncio.DatagramProtocol]`

Create a factory for ZoomiesDatagramProtocol.

Returns a no-arg callable suitable for create_datagram_endpoint().

##### Parameters

Name
Type
Description

`app`
`ASGIApp`

`config`
`ServerConfig (/pounce/api/config/#ServerConfig)`

`logger`
`logging.Logger`

`server`
`tuple[str, int]`

`quic_config`
`Any`

`lifespan_state`
`dict[str, Any] | None`

Default:`None`

`worker_id`
`int`

Default:`0`

##### Returns

`Callable[[], asyncio.DatagramProtocol]`
