:right-sidebar: True WebsocketExtension =================================================================== .. currentmodule:: gi.repository.Soup .. class:: WebsocketExtension(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` Subclasses: :class:`~gi.repository.Soup.WebsocketExtensionDeflate` A WebSocket extension :obj:`~gi.repository.Soup.WebsocketExtension` is the base class for WebSocket extension objects. Methods ------- .. rst-class:: interim-class .. class:: WebsocketExtension :no-index: .. method:: configure(connection_type: ~gi.repository.Soup.WebsocketConnectionType, params: dict[~typing.Any, ~typing.Any] | None = None) -> bool Configures ``extension`` with the given ``params``\. :param connection_type: either :const:`~gi.repository.Soup.WebsocketConnectionType.CLIENT` or :const:`~gi.repository.Soup.WebsocketConnectionType.SERVER` :param params: the parameters .. method:: do_configure(self, connection_type: ~gi.repository.Soup.WebsocketConnectionType, params: dict[~typing.Any, ~typing.Any] | None = None) -> bool :param connection_type: :param params: .. method:: do_get_request_params(self) -> str | None .. method:: do_get_response_params(self) -> str | None .. method:: do_process_incoming_message(self, header: int, payload: ~gi.repository.GLib.Bytes) -> ~typing.Tuple[~gi.repository.GLib.Bytes, int] :param header: :param payload: .. method:: do_process_outgoing_message(self, header: int, payload: ~gi.repository.GLib.Bytes) -> ~typing.Tuple[~gi.repository.GLib.Bytes, int] :param header: :param payload: .. method:: get_request_params() -> str | None Get the parameters strings to be included in the request header. If the extension doesn't include any parameter in the request, this function returns :const:`None`. .. method:: get_response_params() -> str | None Get the parameters strings to be included in the response header. If the extension doesn't include any parameter in the response, this function returns :const:`None`. .. method:: process_incoming_message(header: int, payload: ~gi.repository.GLib.Bytes) -> ~typing.Tuple[~gi.repository.GLib.Bytes, int] Process a message after it's received. If the payload isn't changed the given ``payload`` is just returned, otherwise :obj:`~gi.repository.GLib.Bytes.unref` is called on the given ``payload`` and a new :obj:`~gi.repository.GLib.Bytes` is returned with the new data. Extensions using reserved bits of the header will reset them in ``header``\. :param header: the message header :param payload: the payload data .. method:: process_outgoing_message(header: int, payload: ~gi.repository.GLib.Bytes) -> ~typing.Tuple[~gi.repository.GLib.Bytes, int] Process a message before it's sent. If the payload isn't changed the given ``payload`` is just returned, otherwise :obj:`~gi.repository.Glib.Bytes.unref` is called on the given ``payload`` and a new :obj:`~gi.repository.GLib.Bytes` is returned with the new data. Extensions using reserved bits of the header will change them in ``header``\. :param header: the message header :param payload: the payload data Virtual Methods --------------- .. rst-class:: interim-class .. class:: WebsocketExtension :no-index: .. method:: do_configure(connection_type: ~gi.repository.Soup.WebsocketConnectionType, params: dict[~typing.Any, ~typing.Any] | None = None) -> bool Configures ``extension`` with the given ``params``\. :param connection_type: either :const:`~gi.repository.Soup.WebsocketConnectionType.CLIENT` or :const:`~gi.repository.Soup.WebsocketConnectionType.SERVER` :param params: the parameters .. method:: do_get_request_params() -> str | None Get the parameters strings to be included in the request header. If the extension doesn't include any parameter in the request, this function returns :const:`None`. .. method:: do_get_response_params() -> str | None Get the parameters strings to be included in the response header. If the extension doesn't include any parameter in the response, this function returns :const:`None`. .. method:: do_process_incoming_message(header: int, payload: ~gi.repository.GLib.Bytes) -> ~typing.Tuple[~gi.repository.GLib.Bytes, int] Process a message after it's received. If the payload isn't changed the given ``payload`` is just returned, otherwise :obj:`~gi.repository.GLib.Bytes.unref` is called on the given ``payload`` and a new :obj:`~gi.repository.GLib.Bytes` is returned with the new data. Extensions using reserved bits of the header will reset them in ``header``\. :param header: the message header :param payload: the payload data .. method:: do_process_outgoing_message(header: int, payload: ~gi.repository.GLib.Bytes) -> ~typing.Tuple[~gi.repository.GLib.Bytes, int] Process a message before it's sent. If the payload isn't changed the given ``payload`` is just returned, otherwise :obj:`~gi.repository.Glib.Bytes.unref` is called on the given ``payload`` and a new :obj:`~gi.repository.GLib.Bytes` is returned with the new data. Extensions using reserved bits of the header will change them in ``header``\. :param header: the message header :param payload: the payload data Fields ------ .. rst-class:: interim-class .. class:: WebsocketExtension :no-index: .. attribute:: parent_instance