@property<EOL><INDENT>def message_middleware(self):<DEDENT>
return self._message_middleware<EOL>
Gets or sets the middleware function that is applied to messages before
they are sent out. It can read or manipulate the message and is
expected to return the message to be sent as a bytes object. Signature
is as follows:

.. code-block:: python

   def middleware(
           msg: bytes,
           src_name: str, src_host: str, src_port: int,
           dst_name: str, dst_host: str, dst_port: int) -> bytes:
       return msg