Streaming parser that handles PROXY protocol headers.

Method feed Consume a chunk of data and attempt to parse it.
Method parse Parse a bytestring as a full PROXY protocol header line.
def feed(self, data): (source)

Consume a chunk of data and attempt to parse it.

ParametersdataA bytestring. (type: bytes)
ReturnsA two-tuple containing, in order, an IProxyInfo and any bytes fed to the parser that followed the end of the header. Both of these values are None until a complete header is parsed.
RaisesInvalidProxyHeaderIf the bytes fed to the parser create an invalid PROXY header.
def parse(self, line): (source)

Parse a bytestring as a full PROXY protocol header line.

ParameterslineA bytestring that represents a valid HAProxy PROXY protocol header line. (type: bytes)
ReturnsAn IProxyInfo containing the parsed data.
RaisesInvalidProxyHeaderIf the bytestring does not represent a valid PROXY header.
API Documentation for Twisted, generated by pydoctor at 2018-04-29 21:01:12.