class IProxyParser(zope.interface.Interface): (source)
Known implementations: twisted.protocols.haproxy._v1parser.V1Parser
, twisted.protocols.haproxy._v2parser.V2Parser
Method | feed |
Consume a chunk of data and attempt to parse it. |
Method | parse |
Parse a bytestring as a full PROXY protocol header line. |
Parameters | |
data:bytes | A bytestring. |
Returns | |
A 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. | |
Raises | |
InvalidProxyHeader | If the bytes fed to the parser create an invalid PROXY header. |
Parameters | |
line:bytes | A bytestring that represents a valid HAProxy PROXY protocol header line. |
Returns | |
An IProxyInfo containing the parsed data. | |
Raises | |
InvalidProxyHeader | If the bytestring does not represent a valid PROXY header. |