proxyprotocol.build

proxyprotocol.build.build_socket_result(sock, *, unique_id=None, dnsbl=None)[source]

Build a ProxyResult from the given sock object.

Parameters:
  • sock (socket) – A connected socket object.

  • unique_id (bytes | None) – A unique ID to associate with the connection.

  • dnsbl (str | None) – The DNSBL lookup result for the connection.

Return type:

ProxyResult

proxyprotocol.build.build_transport_result(transport, *, unique_id=None, dnsbl=None)[source]

Build a ProxyResult from the given transport object.

Parameters:
  • transport (TransportProtocol) – A connected transport object.

  • unique_id (bytes | None) – A unique ID to associate with the connection.

  • dnsbl (str | None) – The DNSBL lookup result for the connection.

Return type:

ProxyResult