proxyprotocol.server

class proxyprotocol.server.Address(addr, *, server=False)[source]

Parses an address on the command-line. Valid examples include:

  • HOST

  • HOST:PORT

  • HOST:PORT?pp=v1

  • ssl://HOST:PORT (outbound addresses only)

  • ssl://HOST:PORT?cert=/path/to/cert.pem

  • ssl://HOST:PORT?cert=cert.pem&key=privkey.pem&verify=CERT_REQUIRED

Parameters:
  • addr (str) – The address string to parse.

  • server (bool) – True for server-side (listen) addresses.

property host: str

The hostname parsed from the address.

property port: int | None

The port parsed from the address.

property pp: ProxyProtocol

The PROXY protocol implementation.

property ssl: SSLContext | None

The SSLContext to use on the address.