Events

class webtransport.events.WebTransportEvent

Base class for WebTransport events.

class webtransport.events.WebTransportConnectReceived(path, response_headers)

The WebTransportConnectReceived event is fired whenever an extended CONNECT method is received for WebTransport.

path: str

The :path pseudo header value in the extended CONNECT method.

response_headers: List[Tuple[bytes, bytes]]

The response headers which will be sent to the peer. :status is set to 200 when it isn’t specified.

class webtransport.events.WebTransportSessionEstablished(path)

The WebTransportSessionEstablished event is fired whenever a webtransport session is established.

path: str

The path.

class webtransport.events.UnidirectionalStreamOpened(stream_id, data)

The UnidirectionalStreamOpened event is fired whenever the peer initiated a unidirectional WebTransport stream.

stream_id: int

The ID of the stream the data was received for.

data: bytes

The first chunk of body which was received with the opening.

class webtransport.events.BidirectionalStreamOpened(stream_id, data)

The BidirectionalStreamOpened event is fired whenever the peer initiated a bidirectional WebTransport stream.

stream_id: int

The ID of the stream the data was received for.

data: bytes

The first chunk of body which was received with the opening.

class webtransport.events.UnidirectionalStreamDataReceived(stream_id, data)

The UnidirectionalStreamDataDataReceived event is fired whenever a chunk of body is received on a WebTransport unidirectional stream.

stream_id: int

The ID of the stream the data was received for.

data: bytes

The chunk of body which was received.

class webtransport.events.BidirectionalStreamDataReceived(stream_id, data)

The BidirectionalStreamDataReceived event is fired whenever a chunk of body is received on a WebTransport bidirectional stream.

stream_id: int

The ID of the stream the data was received for.

data: bytes

The chunk of body which was received.

class webtransport.events.DatagramReceived(data)

The DatagramReceived event is fired whenever the peer sent a WebTransport datagram.

data: bytes

A chunk of body which was received.