proxyprotocol.reader¶
- class proxyprotocol.reader.ProxyProtocolReader(pp)[source]¶
Read a PROXY protocol header from a stream.
- Parameters:
pp (ProxyProtocol) – The PROXY protocol implementation.
- async read(reader)[source]¶
Read a complete PROXY protocol header from the input stream and return the result.
- Parameters:
reader (StreamReaderProtocol) – The input stream.
- Return type:
- get_callback(callback, timeout=3)[source]¶
Get a callback object for use as the client_connected_cb argument to
asyncio.start_server().The returned callback will first read the PROXY protocol header before starting the provided callback as a
Task. The callback argument is similar to client_connected_cb but with an additional positional argument – theSocketInforead from the header.- Parameters:
- Return type: