Types¶
- websockets.typing.Data = str | bytes¶
Types supported in a WebSocket message:
strfor a Text frame,bytesfor a Binary frame.
- websockets.typing.BytesLike = bytes | bytearray | memoryview¶
Types accepted where
bytesis expected.
- websockets.typing.DataLike = str | bytes | bytearray | memoryview¶
Types accepted where
Datais expected.
- websockets.typing.LoggerLike = logging.Logger | logging.LoggerAdapter¶
Types accepted where a
Loggeris expected.
- websockets.typing.StatusLike = http.HTTPStatus | int¶
Types accepted where an
HTTPStatusis expected.
- websockets.typing.Origin = websockets.typing.Origin¶
Value of a
Originheader.
- websockets.typing.Subprotocol = websockets.typing.Subprotocol¶
Subprotocol in a
Sec-WebSocket-Protocolheader.
- websockets.typing.ExtensionName = websockets.typing.ExtensionName¶
Name of a WebSocket extension.
- websockets.typing.ExtensionParameter¶
Parameter of a WebSocket extension.
- websockets.protocol.Event = websockets.http11.Request | websockets.http11.Response | websockets.frames.Frame¶
Events that
events_received()may return.
- websockets.datastructures.HeadersLike = websockets.datastructures.Headers | collections.abc.Mapping[str, str] | collections.abc.Iterable[tuple[str, str]] | websockets.datastructures.SupportsKeysAndGetItem¶
Types accepted where
Headersis expected.In addition to
Headersitself, this includes dict-like types where both keys and values arestr.