proxyprotocol.version

class proxyprotocol.version.ProxyProtocolVersion(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Enumerates the supported PROXY protocol versions.

NOOP = <proxyprotocol.noop.ProxyProtocolNoop object>

Do not read a PROXY protocol header from the input stream.

DETECT = <proxyprotocol.detect.ProxyProtocolDetect object>

The version should be detected from the signature. This is the recommended choice.

V1 = <proxyprotocol.v1.ProxyProtocolV1 object>

Use PROXY protocol version 1.

V2 = <proxyprotocol.v2.ProxyProtocolV2 object>

Use PROXY protocol version 2.

classmethod get(name=None)[source]

From name, return a PROXY protocol implementation class. If name is empty or None, ProxyProtocolNoop is returned.

Parameters:

name (str | None) – The name of the implementation.

Raises:

KeyError

Return type:

ProxyProtocol